AWS Certified Developer – Associate (DVA-C02)DeploymentHard
A company is using AWS CodePipeline to deploy a serverless application consisting of AWS Lambda functions. They want to implement a deployment strategy that gradually shifts traffic to the new Lambda function version and automatically rolls back if errors are detected. They also need to ensure that the new version is tested with a small percentage of production traffic before full cutover. Which deployment type in CodeDeploy for Lambda should they configure?
- ALinear
- BCanary
- CAllAtOnce
- DBlue/Green
Show answer & explanationAnswer & explanation
Correct answer: B. Canary
The requirements of gradually shifting traffic, monitoring for errors, automatic rollback, and testing with a small percentage of production traffic are all hallmarks of a Canary deployment strategy. CodeDeploy supports Canary deployments for Lambda functions.
Why the other options are wrong
- A. Linear shifts traffic in equal increments over time, but Canary is specifically designed for the 'small percentage of traffic first' and 'automatic rollback' with monitoring.
- C. AllAtOnce shifts all traffic instantly, without gradual shift or monitoring.
- D. Blue/Green shifts all traffic at once between two environments, which is not gradual for the purpose of testing a small percentage.
CodeDeploy Lambda Canary Deployment
AWS CodeDeploy can manage Lambda deployments using a Canary strategy, where a new function version receives a small percentage of traffic, is monitored, and then gradually rolled out (or rolled back) based on predefined alarms. This minimizes risk during serverless updates.
- Gradual traffic shift for Lambda.
- Monitors for errors using CloudWatch alarms.
- Automated rollback on alarm trigger.
- Minimizes impact of faulty deployments.
Memory trick: Canary for Lambda: a cautious flight, small traffic test, then all in sight.