-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: tag the spot instance. #4380
Conversation
Thanks for this! Can we add an acceptance test (or enhance an existing test) to verify that tags are set on the instance and cover this behavior? |
Nice |
We could really use this capability - hoping it gets added soon! |
+1 |
Not to split hairs here but there is technically a difference between tagging the SpotInstanceRequest itself versus tagging the EC2 Instance which it generates. Maybe using a different attribute like (Or since |
Another comment: what happens with persistent requests when the instance is terminated and a new instance is later auto-created, presumably the new instance will no longer have the tags? |
+1 for this pull request to be accepted |
@fctucker one thing to note here is that with persistent spot requests, if the bid price is hit and the instance stops and starts again, the tags will be not be added to the newly spawned instance. While this PR can behave as a stop-gap, I think everyone who wants support for this should ask AWS to support PropagateAtLaunch for SpotInstanceRequest tags in the same way it works for AutoScalingGroup tags, as that's a much better solution. |
👍 to get this merged ; ideally it's added as an option = tag_instance true/false with default behaviour to false to be backwards compatible |
Recently ran into this as well, would be great to get merged |
FWIW, I think that @johnnyshields is correct here - I am going to open a feature request to AWS about this - feels like |
just opened this aws/aws-sdk-go#804 |
FYI, the tests for this PR work as expected:
I made one modification, I check to see if the instance has the tags as expected
|
We can wait and see what AWS has to say before merging this as a stop-gap |
It would be super helpful to document that tags are only attached/detached if |
AWS now supports tagging natively for spot instances/fleets so this work-around should no longer be necessary if terraform updates its API params: https://aws.amazon.com/about-aws/whats-new/2017/07/tag-your-spot-fleet-ec2-instances/ |
This PR should be closed and we should raise a new PR to support it natively. |
Closing for the reasons mentioned. There's a new PR in the new repository also: hashicorp/terraform-provider-aws#1366 |
PR #1366 does NOT fix this, instead if fixes the spot fleet requests. This PR is created for spot instances, so it is still needed. |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fix #3263