AWS ECS
Run Rivet workers on Amazon ECS with Fargate.
Workers run in runner mode here: the task opens a connection out to the control plane on startup. It needs no load balancer and no public address.
Requirements
- An AWS account with ECS and Fargate available
- A container registry, typically ECR
- A control plane, either Rivet Cloud or your own
Steps
A reference deployment is published as the AWS ECS template, with two paths:
Whichever path you take, two things in the task definition are specific to Rivet:
stopTimeout. Actors drain for up to 30 minutes. Fargate capsstopTimeoutat 120 seconds, so a worker cannot fully drain within a single task stop. Plan rollouts so old tasks overlap new ones, and keepminimumHealthyPercentat 100 so capacity is added before it is removed.- The endpoint variables. Set
RIVET_ENDPOINTandRIVET_PUBLIC_ENDPOINTthrough thesecretsblock, backed by Secrets Manager, rather than plainenvironmententries. Both values are described in Workers.
Verify
aws ecs describe-services --cluster <cluster> --services <service> \
--query 'services[0].runningCount'
Once tasks are running they appear under Runners in the dashboard. Nothing needs registering.
Autoscaling
Runner-mode tasks are interchangeable, so ECS Service Auto Scaling can drive the desired count. Use target tracking on ECSServiceAverageCPUUtilization at 60%, with a minimum of two tasks.
Scale-in is the caveat. It is bound by the same 120 second stopTimeout cap, so actors on a removed task are cut off rather than drained. Set a long scale-in cooldown, or leave the desired count fixed and change capacity at deploy time instead.