When I set up Prefect in ECS, I went ahead and cre...
# ask-community
e
When I set up Prefect in ECS, I went ahead and created the prefect worker task definition, but I noticed that there is also a prefect task definition for the Prefect flow run execution. Was that created by Prefect?
j
Apologies if I'm misunderstanding but the
ECSWorker
will create a task definition for flow run execution if a Task Definition ARN is not provided via the work pool ordeployment
e
Then does the ecsworker also create new revisions of the task definition when configs are updated?
j
yes it does 👍
the Worker also caches the definition locally and will detect changes to avoid excessively hitting the registration endpoint, because AWS is pretty strict about rate limiting it
👀 1
e
Ah I see. I manually added stuff to my task definition (logging and whatnot), but it seems that I should figure out how to push that back in the prefect level and let the Ecsworker handle it instead of trying to manage two different configs levels
Oh that’s why it’s caching it. That’s nice
j
Really up to you where you'd prefer to handle. FWIW I also find it easier to manage it inside prefect instead of bouncing between AWS and Prefect if I can avoid it
e
Is there an example of how I can add cloudwatch logging configs at the Prefect level instead of adding it at the task definition level?
j
I don't have an example unfortunately but you can set it on the work pool by toggling this on and then passing any additional options in the field below:
prefect will add the following to your container log config in your task definition based on those values: https://github.com/PrefectHQ/prefect-aws/blob/main/prefect_aws/workers/ecs_worker.py#L1209-L1219