How do you set up zero-downtime deployments on AWS?

Neil Millard

AWS supports a number of compute runtimes. EC2 instances, ECS tasks, Lambda and others.

The choices are the same for zero-downtime deployments.

  1. Blue-Green: Have a passive mirror of the live environment, update the mirror, test the deployment, switch the load balancer to the new environment.
  2. Rolling update: Provision new servers or tasks, and swap them out of the live group one at a time. This is the cheaper option as you do not have to have a full live size environment, but it takes longer.

For ECS/Fargate specifically, this is built in via a configurable minimum/maximum healthy percent during rollout (commonly 100%/200% for blue-green-style safety); for Lambda, it's a weighted alias splitting traffic between the old and new function versions.

Need help with your DevOps setup?

Get personalised advice from Neil Millard — DevOps consultant based in Weston-super-Mare.