aws / aws/containers-roadmap

[Batch] [Feature Request]: Propagate Batch resource tags to underlying ECS resources (clusters and task definitions)

Open
#2,794 0 comments 6 reactions 0 assignees View on GitHub
Batch ECS Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
When AWS Batch creates a Fargate-based compute environment, it provisions underlying ECS resources (an ECS cluster and ECS task definitions) behind the scenes. Currently, tags applied to Batch resources (compute environments, job definitions, job queues, and jobs) do not propagate to these underlying ECS resources.

We are requesting a native mechanism to propagate tags from Batch resources to the ECS clusters and ECS task definitions that Batch creates and manages internally. This could work similarly to the existing `propagateTags` parameter on job definitions (which currently only propagates tags to ECS tasks), but extended to cover ECS clusters and task definitions as well.

**Which service(s) is this request for?**
AWS Batch, ECS, Fargate

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Organizations that enforce tagging policies for cost allocation, compliance, and governance need all resources, including those created by managed services, to carry consistent tags. When using AWS Batch with Fargate, the underlying ECS clusters and task definitions are created and managed by Batch, and customers have no way to automatically apply tags to them.

Currently:
- Compute environment tags do **not** propagate to the underlying ECS cluster (documented behavior).
- Job definition and job queue tags do **not** propagate at all.
- Job tags with `propagateTags=true` only propagate to ECS **tasks**, not to ECS clusters or task definitions.

This creates a gap where ECS resources managed by Batch appear untagged, breaking cost tracking, compliance audits (e.g., AWS Config rules), and SCP-based tag enforcement policies.

The impact is that customers must either:
1. Manually tag ECS resources after Batch creates them (error-prone, not scalable).
2. Build custom automation (EventBridge + Lambda) to detect Batch resource creation and retroactively tag the underlying ECS resources.

Neither approach is ideal for production environments at scale.

**Are you currently working around this issue?**
The current workarounds are:
1. Manually tagging ECS clusters and task definitions after Batch creates them using `aws ecs tag-resource`.
2. Setting up Amazon EventBridge rules to detect Batch compute environment creation events and triggering a Lambda function to apply tags to the underlying ECS resources.

Both workarounds add operational overhead and complexity.

**Additional context**
- The existing `propagateTags` parameter on job definitions demonstrates that the concept of tag propagation from Batch to ECS already exists — it just needs to be extended to cover ECS clusters and task definitions.
- Related open issues: [#2226](https://github.com/aws/containers-roadmap/issues/2226) (Batch launch template tag propagation), [#341](https://github.com/aws/containers-roadmap/issues/341) (Propagate container instance and service tags to task).
- AWS documentation confirming the limitation: [Tag your AWS Batch resources](https://docs.aws.amazon.com/batch/latest/userguide/tag-resources.html)

**Attachments**
N/A

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked AWS documentation on tagging Batch resources and the related issues #2226 and #341, then examine how the existing `propagateTags` behavior is described for job definitions and tasks. Done means AWS Batch provides a native, documented way for tags to reach the managed ECS clusters and task definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.