Skill 5.2.5

Implement deployment strategies that provide rollback capabilities (for example, blue/green, canary, rolling deployments).

Key Concepts

CodeDeploy supports in-place and blue/green for EC2, and canary, linear or all-at-once traffic shifting for Lambda (aliases) and ECS (with test listeners), with automatic rollback on CloudWatch alarms. Elastic Beanstalk offers all-at-once, rolling, rolling with additional batch, immutable, traffic splitting and blue/green (CNAME swap).

Other options: ALB weighted target groups, Route 53 weighted records, Auto Scaling instance refresh with checkpoints, CloudFormation rollback triggers and change sets. Choose blue/green when you need instant rollback and can afford duplicate capacity; canary to limit blast radius.

Amazon ECS supports native blue/green, linear and canary deployments with automatic rollback on CloudWatch alarms and lifecycle hooks, without CodeDeploy; the deployment circuit breaker rolls back rolling updates that fail to stabilise. Lambda uses aliases with weighted routing, which CodeDeploy shifts in canary or linear steps.