AWS › AWS CodePipeline, CodeBuild & CodeDeploy (CI/CD)

How can CodeDeploy support canary deployments, and how does this differ from a standard blue green deployment?

Advanced

Answer

A canary deployment gradually shifts a small percentage of traffic to the new version first, such as ten percent, monitors that subset closely for errors or performance issues over a defined interval, and only if that canary phase succeeds does it shift the remaining traffic to the new version, allowing you to detect problems affecting only a small fraction of real users before a full rollout, which offers a more gradual and cautious approach than an all at once blue green traffic shift.
aws deploy create-deployment-config --deployment-config-name Canary10Percent5Minutes --traffic-routing-config type=TimeBasedCanary,timeBasedCanary='{"canaryPercentage":10,"canaryInterval":5}'
Real-world example A high traffic e commerce platform uses a canary deployment strategy for its checkout service, routing just ten percent of live traffic to a new version for five minutes and automatically rolling back if error rates increase, before shifting the remaining ninety percent of traffic.

Common follow-ups: How does CodeDeploy automatically decide to roll back during a canary deployment?;What CloudWatch alarms are commonly used to gate a canary deployment's progression?