A retail company is launching a new serverless microservice using AWS Lambda and Amazon API Gateway. To minimize deployment risk for new updates, a solutions architect must design a deployment strategy that routes of API traffic to the new version of the Lambda function. The strategy must monitor the deployment for a period of minutes using Amazon CloudWatch alarms, and automatically roll back to the previous version within seconds if errors are detected. If no errors are detected, the remaining traffic must be routed to the new version. Which deployment strategy and configuration meets these requirements with the least operational overhead?
- ADeploy the updates using AWS CodeDeploy with the CodeDeployDefault.LambdaLinear10PercentEvery1Minute deployment configuration, and configure CloudWatch alarms to monitor Lambda execution errors for automatic rollback.
- BConfigure Amazon API Gateway stage variables and use Amazon Route 53 weighted routing to split traffic 90/10 between two active stages, using a custom Lambda function to update DNS records if errors occur.
- Deploy the updates using AWS CodeDeploy with the CodeDeployDefault.LambdaCanary10Percent15Minutes deployment configuration, and configure CloudWatch alarms to monitor Lambda execution errors for automatic rollback.Cevap
- DDeploy two independent CloudFormation stacks for the stable and new versions, use an Application Load Balancer with weighted target groups to split traffic 90/10, and use AWS Step Functions to manage the rollback logic.
Cevap
Deploy the updates using AWS CodeDeploy with the CodeDeployDefault.LambdaCanary10Percent15Minutes deployment configuration, and configure CloudWatch alarms to monitor Lambda execution errors for automatic rollback.
The correct option is to use AWS CodeDeploy with the canary configuration because it natively implements the two-phase traffic-shifting pattern. It routes of traffic to the new version of the Lambda function (via alias weights), monitors for minutes, and uses CloudWatch alarms to perform a rapid rollback if errors are detected. This is a fully managed, configuration-driven approach with the lowest operational complexity.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy Canary Deployments for Lambda