1 Answer
- Newest
- Most votes
- Most comments
0
Hi, good question!
One way to do so is to use the Tags property of the AWS::Batch::ComputeEnvironment resource. Unfortunately, not all tags propogate by default at the Stack Level.
One those tags are set at the Compoute Resource, it will tag the EC2 instances: https://docs.aws.amazon.com/batch/latest/APIReference/API_ComputeResource.html#Batch-Type-ComputeResource-tags
For example, the AWS::Batch::JobDefinition resource will only propogate tags when the property, PropogateTags is set to true. Same goes for an Autoscaling group with TagProperty.
answered 3 years ago
Relevant content
- asked 3 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
So, essentially, you are confirming that it's not possible to dynamically and meaningfully set tags on all significant resources, when deploying a Cloudformation stack. That's very sad, as it's going to make it significantly more complex to evaluate costs for my AWS Batch-based applications. If only because the tags on ComputeResource are in the format Name=Value (and not {Name=name, Value=value} as for tags on most resources), thereby not making it possible to have tag names defined via template parameters.
AWS Batch and CFN teams, if you are reading, this is something you might want to improve on...