How to propogate tags to an ECS Task launched from an EventBridge Target?

Viewed 695

I have a EventBridge (previously CloudWatch Events) Rule and Target that are used to launch ECS Tasks on a schedule (cron). I would like to apply some tags to the Task.

I tried including tags in RegisterTaskDefinition, but this did not result in any tags being set on the Tasks, as RunTask does not propagate tags if propagateTags is unspecified.

PutTargets is the action to create the event target that will eventually call RunTask. I searched in ecsParameters (EcsParameters) and input (TaskOverride) for fields that would correspond to either tags or propagateTags from RunTask but I could not find any corresponding fields.

Is there any way to apply tags to an ECS Task that is run from an EventBridge rule target?

2021-06-24 update (thanks @baxang): EventBridge has added ecsParameters.PropagateTags: "TASK_DEFINITION" to the API documentation and to some SDKs yesterday (containers-roadmap#89)!

1 Answers
Related