Skip to content

Latest commit

 

History

History

ecs-worker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Example: ECS worker

This example uses the AWS VPC module to create the AWS resources required for a functional ECS cluster to host the Prefect worker.

Usage

Once the Terraform plan is applied successfully, you can test it by assigning a Deployment to the new ECS work pool. An example of the configuration for this is available in the example prefect.yaml file. See the Prefect YAML documentation for more information.

The build and push steps defined in this file will build the sample flow into a Docker image and push it to the ECR repository created by Terraform. Some portions of this file will need to be replaced by the unique resource names created in AWS.

Run prefect deploy hello_world.py:hello_world and follow the prompts. Once complete, you will see your Deployment in the UI. You can then start a run from the UI, or using the suggested command from the CLI. The flow run will execute on your new ECS work pool.

References

As an alternative to prefect.yaml, deployments can be managed by Terraform using the Prefect provider's deployment resource.

Requirements

Name Version
aws ~> 5.0

Providers

Name Version
aws ~> 5.0

Modules

Name Source Version
prefect_ecs_worker prefecthq/ecs-worker/prefect 1.0.0
vpc terraform-aws-modules/vpc/aws 5.19.0

Resources

Name Type
aws_ecr_repository.example resource

Inputs

No inputs.

Outputs

No outputs.