Question

Difficulty: MediumDeployment Strategy Design

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 10%10\% of API traffic to the new version of the Lambda function. The strategy must monitor the deployment for a period of 1515 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?

  1. A
    Deploy the updates using AWS CodeDeploy with the CodeDeployDefault.LambdaLinear10PercentEvery1Minute deployment configuration, and configure CloudWatch alarms to monitor Lambda execution errors for automatic rollback.
  2. B
    Configure 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.
  3. Deploy the updates using AWS CodeDeploy with the CodeDeployDefault.LambdaCanary10Percent15Minutes deployment configuration, and configure CloudWatch alarms to monitor Lambda execution errors for automatic rollback.Answer
  4. D
    Deploy 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.

Answer

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 10%10\% of traffic to the new version of the Lambda function (via alias weights), monitors for 1515 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.

Step-by-Step Solution

1
Identify the traffic-shifting pattern requirements.
The requirement specifies routing 10%10\% of traffic to the new version initially, holding it for 1515 minutes, and then promoting the rest. This represents a canary deployment pattern, not a linear pattern.
Choosing the correct deployment pattern (canary vs. linear) ensures that the traffic shifting matches the business requirements.
2
Select the appropriate pre-defined AWS CodeDeploy deployment configuration.
The pre-defined configuration `CodeDeployDefault.LambdaCanary10Percent15Minutes` maps directly to the requirement of routing 10%10\% of traffic to the new Lambda version for 1515 minutes.
Using a native CodeDeploy configuration minimizes custom development and operational overhead.
3
Configure the automated rollback mechanism.
Associate CloudWatch alarms monitoring Lambda execution errors with the CodeDeploy deployment group.
If the alarm is triggered during the 1515-minute canary period, CodeDeploy immediately shifts 100%100\% of traffic back to the original stable version, satisfying the rollback requirement within seconds.

Key Concept

AWS CodeDeploy Canary Deployments for Lambda
Rate this question