-
Notifications
You must be signed in to change notification settings - Fork 4k
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-events-targets] Support tagging when starting a Fargate task from CloudWatch Events #9823
Comments
Adding support for
Potentially related to aws-cloudformation/cloudformation-coverage-roadmap#394 |
Any updates on this? Is there a known workaround to propagate the tags to an |
I'm also interested in updates to this issue. It seems from aws-cloudformation/cloudformation-coverage-roadmap#394 that it should be supported by CloudFormation now, but I can't see any options in cdk. I'm trying to add tags to a ScheduledFargateTask. |
I solved it via #14553 (comment), maybe this is an option for you too |
…#23838) This adds the ability to pass a tagList and the propagateTags flag to EC2 and Fargate ECS tasks triggered by an event. Users can leverage either or both of these attributes to apply tags an ECS task that's triggered through an Event. Both of these attributes are defined in the EcsParameters for a Rule https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-ecsparameters.html. This closes #9823. This is a non-breaking change. These new fields are added as optional with default values such that it won't impact existing stacks. Also note that these are two separate fields: a user can pass either or both but they're not dependent on each other since they have different uses. `propagateTags` will copy tags from the task definition, while `tagList` provides an explicit set of tags to be applied to the task but that are not on the task definition. In either case, these tags are separate from the tags on the EventBridge bus or Rule. I did see that there was previously a PR opened for this in the past which was closed for staleness (#19583). There was a comment on there asking if this could be added to the existing tag system (#19583 (review)). I'm not sure if that would make sense in this case since the resource being created at deploy-time by CloudFormation isn't the resource being tagged. The event rule itself is instead being given the flag to pass along tags onto the Task that it's creating at some time in the future when the schedule triggers.I did see that there was previously a PR opened for this in the past which was closed for staleness (#19583). There was a comment on there asking if this could be added to the existing tag system (#19583 (review)). I'm not sure if that would make sense in this case since the resource being created at deploy-time by CloudFormation isn't the resource being tagged. The event rule itself is instead being given the flag to pass along tags onto the Task that it's creating at some time in the future when the schedule triggers. ---- ### All Submissions: * [x ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [x ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
I saw this issue on aws/containers-roadmap and it's exactly the problem I'm facing now. I'm using EcsTask and EcsTaskProps to schedule Fargate tasks using CloudWatch Events rule. Since the scheduled task will run without ECS service, I can't use propagateTags or propagateTaskTagsFrom props.
Use Case
Mainly for billing. By having specific tags, I can use them in AWS Cost Explorer to see the cost breakdown for my scheduled tasks vs normal tasks (i.e. web containers).
Proposed Solution
Something like this would be great:
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: