Skip to content

Deploy on ECS with CloudFormation

The CloudFormation templates (cfn/) and the scripts (standup.sh, update.sh, release-ecr.sh, pause.sh, teardown.sh, …) for the native AWS adapter (ecs / ecs-ec2): one ECS service per workspace, scaled to zero when it stops. The procedures that use them are in the operator guide:

Page What it covers
Understand the ECS layout What CloudFormation builds and what the Control Plane builds, the stacks and their deploy order
Build on ECS Account prerequisites (service-linked roles, cost allocation tags, capabilities), the ECR push, the 30-ingress stand-up
Turn on optional features with stack parameters Preview subdomains, keys at rest on KMS (and running af-cp as a one-off task), remote MCP, provided routes, timers and outside engines, WAF
Set up the alarm for an unreachable database CpAlarmEmail, the 20-platform redeploy, recovery
Set the default workspace size Workspace CPU, memory and working disk
Turn on timed wakes Scheduled execution
Pin the outbound IP address The address a customer allow-lists
Control outbound traffic with a gateway EgressRoute=gateway
Add Japanese read-aloud The VOICEVOX engine (cfn/50-tts.yaml)
Add inference engines The fleet’s own engines (cfn/60-engines.yaml)
Start using the EC2 slot pool WsRuntime=ecs-ec2: the stand-up and rollback, the parameters, the memory reserve, the I/O alarms, the golden snapshot, AZs
Choose the slots’ machine types Slot classes, Graviton (arm64), Ec2SlotAmiArm64, the default class
Set up home hibernation and spare copies Hibernating unused homes, spare copies and restoring from one, destroying a workspace
Replace and stop slots Outdated and unresponsive slots, moving retained slots onto new user data
Troubleshoot the slot pool Quarantined slots, start failures, slow first starts, cost, hibernation and spare copies by symptom
Upgrade on ECS update.sh, the manual steps, rollback, clear-params.sh, slot AMIs, upgrading from v0.34.x
Back up and restore EFS EFS backup and restore
Keep costs down Cost and ephemerality
Stand up, pause and tear down with the scripts The lifecycle scripts
Tear a deployment down Teardown and the orphan sweep
IAM permissions for deploying The deploying principal’s least privilege, the CpTaskRole policy budget
Keep templates under the size limit The 51,200-byte limit and the S3 hand-off
Troubleshoot ECS Build, parameter, upgrade and start problems by symptom, including a cold start answering starting

The parameter references stay next to the templates they describe: cfn/PARAMETERS.md (30-ingress) and cfn/PARAMETERS-60-engines.md (60-engines).

Egress IP (the address a customer allow-lists)

Section titled “Egress IP (the address a customer allow-lists)”

Moved to the guide: Pin the outbound IP address.

Egress gateway (EgressRoute=gateway, ADR 0122)

Section titled “Egress gateway (EgressRoute=gateway, ADR 0122)”

Moved to the guide: Control outbound traffic with a gateway.

Workspace size (CPU / memory / working disk)

Section titled “Workspace size (CPU / memory / working disk)”

Moved to the guide: Set the default workspace size.

Moved to the guide: Turn on timed wakes.

Optional: Japanese speech (the VOICEVOX engine, cfn/50-tts.yaml)

Section titled “Optional: Japanese speech (the VOICEVOX engine, cfn/50-tts.yaml)”

Moved to the guide: Add Japanese read-aloud.

Optional: the fleet’s own inference engines (cfn/60-engines.yaml)

Section titled “Optional: the fleet’s own inference engines (cfn/60-engines.yaml)”

Moved to the guide: Add inference engines.

Optional: EC2 slot pool (WsRuntime=ecs-ec2)

Section titled “Optional: EC2 slot pool (WsRuntime=ecs-ec2)”

Moved to the guide: Start using the EC2 slot pool, Choose the slots’ machine types, Set up home hibernation and spare copies and Troubleshoot the slot pool.

Moved to the guide: Replace and stop slots.

Moved to the guide: Keep costs down.

Moved to the guide: Back up and restore EFS.

Lifecycle scripts (stand up / pause / tear down)

Section titled “Lifecycle scripts (stand up / pause / tear down)”

Moved to the guide: Stand up, pause and tear down with the scripts.

Moved to the guide: Tear a deployment down.

Moved to the guide: the af- name prefix is in Understand the ECS layout, the sandbox deploying principal in IAM permissions for deploying, and AuthMode=dev in Troubleshoot ECS.

For agents

Send this prompt to your agent to read this page.

Read https://agent-fleet.org/docs/operate/runbooks/aws-ecs/index.md