agent-ec2
aws-ia/agent-ec2/prefect
Terraform module for deploying the Prefect Agent on AWS EC2
Prefect Docker Agent on AWS EC2 Module The Prefect Agent is a lightweight process that orchestrates flow runs. It is responsible for starting and monitoring flow runs. During operation the agent process queries the Prefect API for any scheduled flow runs, and allocates resources for them on their respective deployment platforms. This Terraform module deploys the infrastructure required to run the Prefect Docker agent on AWS EC2. By default, it deploys AWS VPC Networking resources, which are best practice for Prefect configuration. You can disable the default networking as show in the bring your own network example. !architecture diagram Prerequisites 1. Generate an API service account key for the agent 2. Store the API key in AWS Secrets Manager in the console, or using the following CLI c
| Name | Type | Description | Default |
|---|---|---|---|
| key_name | string | private pem key to apply to the prefect instances | required |
| iam_role_id | string | iam role to attach to the prefect launch template, if not provided, a default on | required |
| security_group_ids | list(string) | security group(s) to attach to the prefect launch template, if not provided, a d | required |
| enable_detailed_monitoring | bool | enable detailed monitoring on the prefect agent (1 min intervals) | true |
| enable_single_nat_gateway | bool | enable a shared nat gateway within your vpc | false |
| attach_ssm_policy | bool | Attach ssm policy to the prefect iam role | true |
| instance_type | string | AWS instance type | "t3.medium" |
| ami_id | string | ami to launch the ec2 instance from, windows images not supported | "" |
| max_capacity | number | the maximum size of the auto scaling group | 1 |
| enable_local_flow_logs | bool | enables flow logs to output locally on the agent | false |
| vpc_id | string | id of the vpc to deploy the prefect agent into | "" |
| desired_capacity | number | the number of prefect agents that should be running in the auto scaling group | 1 |
| custom_tags | map(any) | custom tags which can be passed on to the AWS resources. they should be key valu | {} |
| prefect_api_key_secret_name | string | id of aws secrets manager secret for prefect api key | "prefect-api-key" |
| prefect_secret_key | string | key of aws secrets manager secret for prefect api key | "key" |
| agent_automation_config | string | config id to apply to the prefect agent to enable cloud automations | "" |
| disable_image_pulling | string | disables the prefect agents ability to pull non-local images | false |
| deploy_network | bool | deploy lightweight network to host the prefect agent | true |
| vpc_cidr | string | cidr range to apply to your vpc | "192.168.0.0/24" |
| linux_type | string | type of linux instance | "linux_amd64" |
| min_capacity | number | the minimum size of the auto scaling group | 1 |
| prefect_api_address | string | the api address that the prefect agent queries for pending flow runs | "https://api.prefect.io" |
| prefect_labels | string | labels to apply to the prefect agent | "[]" |
prefect_role_id — iam role id of the role attached to the prefect launch template