https://prefect.io logo
a

ale

12/20/2021, 9:47 AM
Hey folks simple smile We are using ECS Agent to execute flows. Is there a way to apply custom tags to the ECS task that is executed?
a

Anna Geller

12/20/2021, 10:16 AM
@ale do you need that for billing purposes? In general, you can add tags to your cluster to which you deploy your ECS agent and all the ECS tasks for your flows deployed to that cluster would inherit those tags.
Copy code
aws ecs create-cluster --cluster-name prefectEcsCluster --tags key=team,value=devs
You can find more details here
a

ale

12/20/2021, 10:28 AM
Thanks Anna! ๐Ÿ™Œ
cc @Giacomo Consonni @grandimk
Well, we do have the right tags on the cluster. But for some unknown reason, they are not applied to tasks running on the cluster ๐Ÿ˜…
We might need to enable tag propagation
Weโ€™ll investigate
a

Anna Geller

12/20/2021, 10:51 AM
Correct, this flag seems to be relevant: --propagateTags Keep us posted, itโ€™s an interesting topic. I think in the worst case, maybe you could track the costs just via the ECS cluster provided that all flows are deployed to the same cluster and only to that cluster.
๐Ÿ‘ 1
a

ale

12/23/2021, 9:53 AM
Hey @Anna Geller ๐Ÿ‘‹ I confirm that using
propagateTags
did the trick! We used this config:
Copy code
enableECSManagedTags: true
propagateTags: TASK_DEFINITION
a

Anna Geller

12/23/2021, 10:57 AM
Nice work and thanks for sharing!
5 Views