ale

    ale

    9 months ago
    Hey folks ๐Ÿ˜’imple_smile: We are using ECS Agent to execute flows. Is there a way to apply custom tags to the ECS task that is executed?
    Anna Geller

    Anna Geller

    9 months ago
    @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.
    aws ecs create-cluster --cluster-name prefectEcsCluster --tags key=team,value=devs
    You can find more details here
    ale

    ale

    9 months ago
    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
    Anna Geller

    Anna Geller

    9 months ago
    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.
    ale

    ale

    9 months ago
    Hey @Anna Geller ๐Ÿ‘‹ I confirm that using
    propagateTags
    did the trick! We used this config:
    enableECSManagedTags: true
    propagateTags: TASK_DEFINITION
    Anna Geller

    Anna Geller

    9 months ago
    Nice work and thanks for sharing!