Hi everyone — I’m trying to pass tags to the ECS R...
# ask-community
b
Hi everyone — I’m trying to pass tags to the ECS Run task, but it doesn’t look like the tags are being propagated. Is this the right way to pass tags to the ECS tasks that the Prefect Agent will create?
a
Do you need it for cost allocation? Generally speaking, you can use the
--propagateTags
flag when starting the ECS Service for the agent. You can also assign the tags to the ECS cluster, and the tags should propagate to ECS tasks as well:
Copy code
aws ecs create-cluster --cluster-name prefectEcsCluster --tags key=prefectOwned,value=true
b
I need it for access control! I managed to solve it by passing the tags as “run_task_kwargs”, as I only need the tags on the actual tasks, not the task definitions
thanks!
a
Does it work using only run_task_kwargs? Can you share your solution with run config? I heard from other user who needed it for billing and cost management and they said it didn’t work for them unless they used the
--propagateTags
 flag.
b
this is my full run config. All tasks that the prefect agent created had the tag, but not the task definition
a
thanks for sharing!