Set tags on instance when using a new Launch Template #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available: #87
Description of changes:
Our new code for launching Spot instances with CreateFleet requires using a Launch Template that we create on the fly. That Launch Template did not include a tag specification, so Spot instances created this way would not have the default Simple-EC2 tags (
CreatedBy
andCreatedTime
) or any user-specified tags. This is a difference from launching On-Demand instances with RunInstances, where the tags are currently set correctly.Testing:
Launched an On-Demand instance and a Spot instance with the new code and verified that they both got the Simple-EC2 tags and my own tags (item
1
below is the Spot instance):Note that the Spot instance also has some default tags related to Fleet and Launch Templates; we're leaving those intact.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.