-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Allow customizing the default target group name, target type, and tags #29
Conversation
main.tf
Outdated
@@ -108,6 +108,8 @@ resource "aws_lb_target_group" "default" { | |||
lifecycle { | |||
create_before_destroy = true | |||
} | |||
|
|||
tags = "${length(var.target_group_tags) == 0 ? module.default_target_group_label.tags : var.target_group_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.
why not provide your custom tags in var.tags
?
Those will be merged in label
module with the a few tags generated by the label
module.
(unless you want a completely separate set of tags. What's the use case?)
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.
why not provide your custom tags in var.tags?
The custom tags are specific to the particular target group and would not make sense being applied to the ALB resource. In my particular case, I want to use a terraform data source to find a target group by a tag specific to the particular kind of workload that will be registered with that target group. Perhaps a compromise might be renaming this target_group_additional_tags
and merging whatever is passed in with the label 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.
yes, add target_group_additional_tags
variable, then merge it with label.tags
(not var.tags
, those are included in the label.tags
- and use the resulting map for the target group 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.
add target_group_additional_tags variable, then merge it with label.tags
done d5c7a49
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.
thanks @stangles
Looks good, but please see the comments and please rebuild README by executing these commands:
make init
make readme/deps
make readme
It will add the new variables and outputs to README.md
automatically.
In general, any changes to README should be made in README.yaml
(not in this case), and after that executing the commands above will rebuild README.yaml
into README.md
and add all new variables and outputs to README.md
thanks
This reverts commit c48f854.
I ran the commands you specified and updated them in 80b2332 It appears there are some unrelated refactorings to the README to source images from a different location, hopefully that's acceptable. |
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.
thanks @stangles
This adds 3 new variables (with original defaults to maintain backwards compatibility with older module versions) to the default target group.
target_group_name
- while the default naming scheme enforced by the null-label is nice, I have found valid use cases for specifying a more descriptive custom name for the default target group (while still preserving the naming scheme for the actual ALB).target_group_target_type
- AWS has three options for target group types, this allows for specifying an option other than the hardcodedip
.target_group_tags
- before this change, the default target group did not have its tags set by the module. This updates it to either optionally pass in your own set of tags (something that I think is useful, just like being able to specify your own target group name) or use the tags passed in to the module that are also applied to the ALB.