Skip to content

AWS::ECS::TaskDefinition - propagateTags #394

@johnkoehn

Description

@johnkoehn

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: some-team@somecompany.com

When propagateTags is set to true, any time task are created, they will assume the tags
teamId: 11623
teamEmail: some-team@somecompany.com

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    computeEC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions