Jon Young
07/07/2025, 7:42 PMMarvin
07/07/2025, 7:42 PMMarvin
07/07/2025, 7:42 PMjson
{
"variables": {
"property_name": "default_value"
},
"job_configuration": {
"property_name": "{{ variables.property_name }}"
}
}
A few important points:
1. The file must contain both variables
and job_configuration
sections
2. Any variable you want to use in job_configuration
must be defined in the variables
section
3. Variables in the job_configuration
section must be referenced using the format {{ variables.property_name }}
For example, if you wanted to set a default Docker image pull policy, your minimal template might look like:
json
{
"variables": {
"image_pull_policy": "IfNotPresent"
},
"job_configuration": {
"image_pull_policy": "{{ variables.image_pull_policy }}"
}
}
For more complex configurations, you can copy the full template from the work pool's Advanced tab in the UI and modify it. This ensures you have access to all available configuration options while maintaining compatibility with your work pool type.
Note that the exact properties available in job_configuration
will depend on your work pool type (Docker, Kubernetes, etc.). The structure above is the minimal template that will work with the CLI command.Jon Young
07/07/2025, 7:43 PMMarvin
07/07/2025, 7:43 PMMarvin
07/07/2025, 7:45 PMjson
{
"variables": {
"cpu": "1024",
"memory": "2048",
"task_role_arn": "",
"execution_role_arn": "",
"launch_type": "FARGATE",
"network_configuration": {
"awsvpcConfiguration": {
"subnets": [],
"assignPublicIp": "ENABLED"
}
}
},
"job_configuration": {
"cpu": "{{ variables.cpu }}",
"memory": "{{ variables.memory }}",
"task_role_arn": "{{ variables.task_role_arn }}",
"execution_role_arn": "{{ variables.execution_role_arn }}",
"launch_type": "{{ variables.launch_type }}",
"network_configuration": "{{ variables.network_configuration }}"
}
}
Important notes:
1. The network_configuration
must use lowercase field names (subnets
, not Subnets
) as Prefect uses boto3 under the hood
2. You'll need to fill in your specific:
- Task role ARN
- Execution role ARN (needs AmazonECSTaskExecutionRolePolicy at minimum)
- Subnet IDs in the network configuration
3. The CPU and memory values shown are examples - adjust them based on your needs
4. The template uses FARGATE as the default launch type, which is the most common choice
This is the minimal structure needed to get an ECS work pool running. You can add more configuration options like tags
, cluster
, or custom container_definitions
as needed, but these are the essential components to get started.
Remember that any values you don't set in the base job template can still be configured later through deployment configuration or the work pool UI.