Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::ECS::TaskDefinition - propagateTags #394

Closed
johnkoehn opened this issue Feb 26, 2020 · 4 comments
Closed

AWS::ECS::TaskDefinition - propagateTags #394

johnkoehn opened this issue Feb 26, 2020 · 4 comments
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository

Comments

@johnkoehn
Copy link

johnkoehn commented Feb 26, 2020

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)
@luiseduardocolon luiseduardocolon added the compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository label Feb 27, 2020
@Ophirr33
Copy link

Ophirr33 commented Apr 3, 2020

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

@clareliguori
Copy link

@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

@baxang
Copy link

baxang commented Jun 24, 2021

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?

@WaelA WaelA changed the title AWS::ECS::TaskDefinition-propagateTags AWS::ECS::TaskDefinition - propagateTags Aug 4, 2021
@pdax-dmwooden
Copy link

What's the update to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository
Projects
None yet
Development

No branches or pull requests

7 participants