AWS::ECS::TaskDefinition-propagateTags
Not sure this will actually be possible or if it even falls under the responsibility of cloudformation but here is my issue.
My team heavily uses fargate for our microserivces. In addition, we use cloudformation and codepipeline to manage our infrastructure and do our deployments. We do several new deployments a day. In addition, we also have autoscaling enabled on most of our APIs based of CPU utilization, so tasks are constantly being spun up and down.
The problem we are facing is our organization uses tagging to bill different teams for there services. To tag our Fargate task, we unfortunately need to be running a lambda every few minutes to list the task for our different ECS services and than tag them.
What we are hoping, is we could eventually set up our cloudformation template in such a way, where our Fargate task assume the tags from the task definition.
When a task is created, it is possible for it to assume the tags from the task definition, see: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html#tag-resources
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-propagateTags
AWS::ECS::TaskDefinition-propagateTags - This would be a new attribute. When the attribute propagateTags is set to true, all tasks created, would assume the tags of there associated task definition.
My task definition has the following tags:
teamId: 11623
teamEmail: [email protected]
When propagateTags is set to true, any time task are created, they will assume the tags
teamId: 11623
teamEmail: [email protected]
When propagateTags is set to false, task created will not assume the tags
Having propagateTags on the task definition would make it easier to propagate tags when setting up scheduled ecs tasks that don't have a service definition
@johnkoehn Since this would require a change to the ECS RegisterTaskDefinition API, can you open an issue on the Containers roadmap? https://github.com/aws/containers-roadmap/issues
Can this be reviewed again?
For ECS/Fargate services, using propagateTags on the service resource will do the job. This allows propagating either from task definition or service giving a better control. (e.g. a task definition is used for more than one service)
For tasks launched via EventBridge::Rule and ECS Target type, the API has propagateTags, but CloudFormation does not have this property. It seems Cfn team can add support for it?
Most helpful comment
Can this be reviewed again?
For ECS/Fargate services, using
propagateTagson the service resource will do the job. This allows propagating either from task definition or service giving a better control. (e.g. a task definition is used for more than one service)For tasks launched via EventBridge::Rule and ECS Target type, the API has
propagateTags, but CloudFormation does not have this property. It seems Cfn team can add support for it?