-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: vpc endpoint names #560
feat: vpc endpoint names #560
Conversation
adding name tag based on var.name and the endpoint service's name
perhaps you could reference the data source instead of hard coding the name?
|
Merge from terraform-aws-modules/terraform-aws-vpc
thanks for the PR @cjtiffin - I'll take a look today |
{ | ||
"Name" = format("%s-%s", var.name, data.aws_vpc_endpoint_service.s3[0].service) | ||
}, | ||
local.vpce_tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this does could work but theres one slight issue - if you try to test this using the examples/complete-vpc
you won't see your changes (all endpoints will still be named complete
). we have a deeply nested overloading of tags going on currently (Name
set here -> var.tags
-> var.vpc_endpoint_tags
). I think to fix and decouple this change a little better, lets do this:
tags = var.vpce_name_include_service ? merge(
local.vpce_tags,
{
"Name" = format("%s-%s", var.name, data.aws_vpc_endpoint_service.codedeploy[0].service)
},
) : local.vpce_tags
And we'll need to add the variable block for the vpce_name_include_service
variable where the default is false
. This means that today if users don't want to change their VPC endpoint names (aka - leave them as they have been up till now), then this change is transparent to them. however, if users want to opt into this change and have the endpoint service name appended to the VPC endpoint name, they can flip the switch by setting vpce_name_include_service = true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good idea. I'll get a new PR put up for this. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjtiffin addressed that here https://github.com/cjtiffin/terraform-aws-vpc/pull/2 - can you please merge ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @bryantbiggs @cjtiffin, shall I make a new direct PR for this or what do you suggest?
comments have been addressed in my branch and PR to @cjtiffin's, https://github.com/cjtiffin/terraform-aws-vpc/pull/2
{ | ||
"Name" = format("%s-%s", var.name, data.aws_vpc_endpoint_service.s3[0].service) | ||
}, | ||
local.vpce_tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjtiffin addressed that here https://github.com/cjtiffin/terraform-aws-vpc/pull/2 - can you please merge ?
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
This PR adds a
Name
tag to any vpc endpoints that are created by the module.At the moment vpc endpoints are passed tags from
local.vpce_tags
; this change merges in aName
tag (based onvar.name
and the endpoint service's name) following the same pattern used throughout the rest of the module.Motivation and Context
This will add more context to any vpc endpoints in the aws console, as well as allowing any testing tools that rely on the
Name
tag (such as awspec) to pick endpoints up for testing.Breaking Changes
None known.
How Has This Been Tested?
Using terraform 0.13.3 I've deployed the module into an aws account with all endpoints enabled; checking that the deployment was successful and that the endpoints were named as I expected.
The endpoints were enabled in two batches, i.e. from
access_analyzer
toelasticbeanstalk_health
, and then fromelasticloadbalancing
toworkspaces
, as aws has a 50 vpc endpoint limit by default.