<@ULVA73B9P> give me an example of a deployment co...
# ask-marvin
r
@Marvin give me an example of a deployment config in yaml that sets the service discovery parameters for the registered task
m
thought for 388.0 seconds
Short answer: Prefect deployments don’t expose “service discovery” settings. In Prefect 3.x, deployments describe your flow and which work pool will run it; infrastructure-specific knobs go in the worker’s job variables. Prefect’s ECS and Kubernetes workers launch one-off jobs/tasks (ECS RunTask, K8s Job) and do not create long‑lived Services, so there are no service discovery fields to set in the deployment YAML. If you’re targeting ECS and looking for AWS Cloud Map/serviceRegistries: that’s only supported when creating an ECS Service, not when running a one-off task. Prefect’s ECS worker uses RunTask, so service discovery isn’t available there. Here’s a minimal Prefect 3.x deployment YAML showing where infra settings would live for ECS (note: no service discovery fields exist):
Copy code
version: 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.