Question #807
A company uses AWS CloudFormation to deploy an application with an Amazon API Gateway REST API integrated with AWS Lambda. Data is stored in Amazon DynamoDB, with separate tables for development, testing, and production stages. The company faces challenges when deploying updates to production, despite success in earlier stages. For the next release, the developer must direct 10% of production traffic to the new version while keeping 90% on the current version, ensuring minimal customer errors.
Which approach meets these requirements?
Deploy the changes incrementally by updating 10% of the production stage's resources at a time using AWS CloudFormation. Monitor each update and proceed only if no errors occur.
Configure Amazon Route 53 with a weighted routing policy for the production API domain. Set one record with a weight of 90 pointing to the current stage and a second record with a weight of 10 pointing to the new stage.
Deploy an Application Load Balancer (ALB) in front of the API Gateway. Register the current and new production stages as target groups with weights of 90% and 10%, respectively. Update the Route 53 record to route traffic to the ALB.
Use canary deployment settings in the API Gateway production stage. Set the canary traffic percentage to 10%, deploy the updates to the production stage, and monitor for errors before shifting all traffic.
Explanation
Answer D is correct because API Gateway's built-in canary deployment feature allows splitting traffic between the existing production stage and a new canary version. By setting the canary traffic percentage to 10%, the developer can safely test the new version with a small portion of users while monitoring for errors. If no issues arise, traffic can be fully shifted. This approach avoids DNS propagation delays (Option B), eliminates the need for complex ALB configurations (Option C), and ensures atomic updates (unlike Option A, which risks partial resource updates).
Key Points:
1. Canary deployments in API Gateway enable controlled, percentage-based traffic shifting.
2. Monitoring and automatic rollback (if configured) minimize customer impact.
3. Other options involve infrastructure changes (ALB) or lack granular traffic control (CloudFormation updates).
Answer
The correct answer is: D