# prefect-community

Chris Gunderson

12/23/2022, 3:29 PM
Hi Prefect Team - We now have a working dev environment with Prefect 2. The ECS Service is running the agent properly. However, for each flow we are creating a new task definition. Will we need to create a separate ECS Service to run the flows? If we create a separate ECS Service and Task Definition for the flows, do we put this task definition in the Prefect block for the ECS Task?

Taylor Curran

12/23/2022, 4:35 PM
The only service that is necessary should be the service to run the agent (if you decide to run the agent in ECS.) since the agent is long-running. Flow runs should be good to run as ECS Tasks. You can either let Prefect define the task for you by filling in the CPU/Memory etc. fields of the ECS block OR you can define the task yourself and pass the definition in the form of JSON as a field to the ECS block.

Chris Gunderson

12/23/2022, 4:42 PM
So, there is no impact to performance by having Prefect define the task each time?

Kalise Richmond

12/23/2022, 5:10 PM
There's no major impact on performance from the Prefect side however depending on the number of new task definitions, you could hit an internal AWS ECS registration rate limit which could block all your flows.

Chris Gunderson

12/23/2022, 5:16 PM
@Kalise Richmond @Taylor Curran Thank you for your help. I'll need to have our admin for AWS check this limit. We will request an increase if necessary. Happy Holidays!

Ben Muller

12/23/2022, 6:05 PM