Skip to content
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

improvement: Tags passed into worker groups should also be excluded from Launch Template tag specification #1095

Merged
merged 12 commits into from
Nov 12, 2020

Conversation

huddy
Copy link
Contributor

@huddy huddy commented Nov 10, 2020

PR o'clock

Description

I recently raised #1092 which allows us to overide tags on the asg and set propagate_at_launch to false to prevent instances from getting the tag.

This works well for launch configuration, but for launch templates we also currently pass in tag_specification for instances which then negates the point of #1092

This PR therefore adds a feature to exclude any tags on the tag specification for instances on the launch templates, that are passed in via worker groups config.

This means we can control if a tag makes it to instance from the ASG or not without the tag specification interfering and the ASG tags become the source of truth for propagation only if they are passed in with worker groups.

Checklist

@huddy huddy marked this pull request as ready for review November 10, 2020 16:27
@barryib barryib self-assigned this Nov 11, 2020
var.tags,
{ for tag_key, tag_value in var.tags :
tag_key => tag_value
if ! contains([for tag in lookup(var.worker_groups_launch_template[count.index], "tags", local.workers_group_defaults["tags"]) : tag["key"]], tag_key)
Copy link
Member

@barryib barryib Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please exclude the tag Name also, like you already did for ASG ? It's more about consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, Yep, I've added this now :)

@barryib barryib added this to the v13.2.1 milestone Nov 11, 2020
@barryib barryib changed the title feat: Tags passed into worker groups are excluded from tag specification. improvement: Tags passed into worker groups are excluded from tag specification. Nov 11, 2020
@barryib barryib changed the title improvement: Tags passed into worker groups are excluded from tag specification. improvement: Tags passed into worker groups should also be excluded from tag specification Nov 11, 2020
@barryib barryib changed the title improvement: Tags passed into worker groups should also be excluded from tag specification improvement: Tags passed into worker groups should also be excluded from Launch Template tag specification Nov 11, 2020
Copy link
Member

@barryib barryib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @huddy.

@barryib barryib merged commit 6321746 into terraform-aws-modules:master Nov 12, 2020
@barryib
Copy link
Member

barryib commented Nov 12, 2020

v13.2.1 is now released

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants