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

fix: Add instance tag specification to launch template #762

Closed
wants to merge 3 commits into from
Closed

Conversation

js-timbirkett
Copy link

@js-timbirkett js-timbirkett commented Mar 5, 2020

PR o'clock

Description

Tags are being applied after instances are launched whils in pending state.

Adding a tag_specification for instance resources allows ensures that
instances are tagged during launch.

Fixes: #753

Checklist

js-timbirkett and others added 3 commits March 5, 2020 09:58
Tags are being applied after instances are launched whils in pending state.

Adding a tag_specification for instance resources allows ensures that
instances are tagged during launch.

Fixes: #753
@max-rocket-internet
Copy link
Contributor

TBH I don't really understand the changes in this PR as I don't have experience here.

@barryib do you know how tag_specifications works and what "Tags are being applied after instances are launched" does?

@barryib
Copy link
Member

barryib commented Mar 9, 2020

@max-rocket-internet I don't use it either, but the use case sounds legit to me. Maybe @dpiddockcmp ?

From what I understood in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html, it's add tags to EC2 instances during their creation.

@Art3mK does this resolve your issue #753 ?

@Art3mK
Copy link

Art3mK commented Mar 10, 2020

yeah, I think so! Thanks for checking this!

Use case is that with spot instances ASG will add tags to instances after those are created

The exception is when you use a launch configuration to launch Spot Instances. For this scenario, your Auto Scaling group adds tags while the instances are in the Pending lifecycle state

Problem with this is that if you have policy, which denies you to launch instance without proper tagging - there is no way currently with this module to do that. And error message from API is very cryptic. See issue. That took me some time to solve that :)

This could be solved with adding that tag_specification for instances also in launch template (there is already one for volumes).

I'm not sure though how these tags for instances defined in launch template will work with tags defined on ASG itself. Would be there any conflicts/overwrites if both defines the same tag?

@max-rocket-internet
Copy link
Contributor

I'm not sure though how these tags for instances defined in launch template will work with tags defined on ASG itself. Would be there any conflicts/overwrites if both defines the same tag?

True. I'm not sure. As there would be a lot of overlap. @js-timbirkett do you know? Are they just merged?

@barryib
Copy link
Member

barryib commented Mar 19, 2020

I'm not sure though how these tags for instances defined in launch template will work with tags defined on ASG itself. Would be there any conflicts/overwrites if both defines the same tag?

True. I'm not sure. As there would be a lot of overlap. @js-timbirkett do you know? Are they just merged?

@js-timbirkett can you confirm please and remove your changes from changelog. It's now auto generated during the release process.

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.

@js-timbirkett are you still working on this ? There are some questions to answer before we get this PR merged.

@@ -9,6 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/).

## [[v9.?.?](https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v9.0.0...HEAD)] - 2020-xx-xx]

- Fix #753 by adding and instance tag spec to launch templates (by @js-timbirkett)
Copy link
Member

Choose a reason for hiding this comment

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

Can you please your changes in changelog ? It's now generated from git commits during release.

@Reuuke
Copy link
Contributor

Reuuke commented Mar 30, 2020

I'm not sure though how these tags for instances defined in launch template will work with tags defined on ASG itself. Would be there any conflicts/overwrites if both defines the same tag?

True. I'm not sure. As there would be a lot of overlap. @js-timbirkett do you know? Are they just merged?

@max-rocket-internet Yep. They just merged. And tags from ASG have a higher priority then tags from LT if they match on tag key (I tested today)

@barryib
Copy link
Member

barryib commented Mar 30, 2020

Great closing this in favor of #822

@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 18, 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.

Tagging spot instances with launch templates
5 participants