Cloudformation-coverage-roadmap: AWS::ECS::TaskDefinition-propagateTags

Created on 26 Feb 2020  路  3Comments  路  Source: aws-cloudformation/cloudformation-coverage-roadmap

AWS::ECS::TaskDefinition-propagateTags

0. My issue

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

2. Scope of request

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.

3. Expected behavior

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

5. Helpful Links to speed up research and evaluation

Tagging ECS resources in general https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html#tag-resources

propagateTag used in the runTask cli call here: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-propagateTags

6. Category (required) - Will help with tagging and be easier to find by other users to +1

  1. Compute (ECS)
compute

Most helpful comment

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?

All 3 comments

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?

Was this page helpful?
0 / 5 - 0 ratings