Moe
10/11/2024, 12:48 PMMarvin
10/11/2024, 1:39 PMprefect-ecs-user
with an associated policy (prefect-ecs-policy
) to manage ECS tasks and store the generated AWS credentials.
- ECS Cluster: You need to create an ECS cluster, for example prefect-ecs-cluster
, to run your Prefect flows.
- VPC: Create a VPC, such as prefect-ecs-vpc
with CIDR 172.31.0.0/16
, for running ECS tasks.
- ECR Repository: Use an ECR repository like prefect-flows
for storing Prefect images.
2. Networking:
- The awsvpc
network mode must be used, as it is the only supported network mode with Fargate. This ensures compatibility with the launch type.
3. Fargate Specifics:
- You must specify memory and CPU at the task level, which is critical since these parameters are required for tasks running on Fargate.
- The task's requiresCompatibilities
should include FARGATE
to ensure proper setup.
4. Deployment and Flow Handling:
- The flow runs need to be configured to send tasks to your configured push workpool in Prefect's web interface, and any AWS Credentials should be securely stored using Prefect's block functionality.
These guidelines ensure your setup is compatible and secure when deploying flows using Fargate on ECS. Here are links to the relevant resources for further reading:
- Prefect 2.x ECS Integration Guide
- Prefect 3.x ECS Integration Guide
If you have any specific questions about certain parts of the setup, feel free to ask!