Ravish Mallya
08/21/2025, 10:26 AMMarvin
08/21/2025, 10:26 AMMarvin
08/21/2025, 10:32 AMversion: 3.0
name: my-project
deployments:
- name: my-flow-on-ecs
entrypoint: flows/my_flow.py:my_flow
work_pool:
name: my-ecs-pool
job_variables:
image: <http://123456789012.dkr.ecr.us-east-1.amazonaws.com/my-image:latest|123456789012.dkr.ecr.us-east-1.amazonaws.com/my-image:latest>
cpu: 1024
memory: 2048
cluster: my-ecs-cluster
task_definition_arn: arn:aws:ecs:us-east-1:123456789012:task-definition/my-taskdef:42
launch_type: FARGATE
subnets: ["subnet-abc", "subnet-def"]
security_groups: ["sg-0123456789abcdef0"]
assign_public_ip: false
env:
PREFECT_LOGGING_LEVEL: INFO
parameters: {}
Helpful references:
- Prefect 3.x deployment YAML guide: prefect.yaml guide
- ECS integration overview: Prefect AWS ECS guide
If you can share which platform you’re targeting (ECS, Kubernetes, something else) and what you need service discovery for, I can suggest an approach. For example:
- ECS: run a separately managed ECS Service (with Cloud Map) and have your flow interact with it; or implement Cloud Map registration from your container entrypoint if you truly need task-level registration.
- Kubernetes: workers launch Jobs (ephemeral Pods). Service discovery typically targets Deployments/Services. If you need a stable endpoint, you’d deploy a Service/Deployment outside Prefect and have your flow call it.