Question

Difficulty: HardDeployment Strategies

An application developer is deploying an updated version of a microservice REST API using Amazon API Gateway. To minimize blast radius, the developer wants to test the update under production conditions by routing 5%5\% of incoming API traffic to the new deployment. The developer also needs to monitor separate Amazon CloudWatch metrics for the test traffic and the production traffic. Once the new deployment is verified, the developer must promote it to receive 100%100\% of the traffic with minimum administrative overhead and without managing additional API Gateway stages. Which deployment strategy should the developer implement to meet these requirements?

  1. A
    Create a new API Gateway stage for the updated API version, configure an Amazon Route 53 weighted routing policy to direct 5%5\% of the traffic to the new stage, and delete the old stage after promotion.
  2. B
    Deploy the updated microservice as a new AWS Lambda function version, configure the API Gateway stage variables to use a weighted Lambda alias pointing to the new version with a 5%5\% weight, and update the weight to 100%100\% after verification.
  3. Configure a canary release on the active API Gateway stage, set the canary traffic percentage to 5%5\%, and then promote the canary to the stage after verification.Answer
  4. D
    Deploy the new API version using a Rolling deployment strategy in API Gateway, configuring the deployment batch size to 5%5\% of the request volume, and roll back the deployment if alarms are triggered.

Answer

Configure a canary release on the active API Gateway stage, set the canary traffic percentage to 5%5\%, and then promote the canary to the stage after verification.
Configuring a canary release on the active API Gateway stage allows the developer to route a specific percentage of traffic (such as 5%5\%) to a new deployment on the same stage. API Gateway automatically generates separate Amazon CloudWatch metrics for the canary traffic, which can be monitored. When verification is complete, promoting the canary updates the stage deployment to the new version and deletes the canary, meeting all requirements with the lowest administrative overhead and without managing multiple stages.

Step-by-Step Solution

1
Evaluate the requirement for splitting traffic at the API Gateway level with separate metrics and no additional stages.
Identify that API Gateway canary releases support splitting traffic on a single stage and provide separate CloudWatch metrics.
This aligns with minimizing stage management and administrative overhead.
2
Set up the canary release on the active stage with 5%5\% traffic.
5%5\% of incoming requests are routed to the new API deployment, and API Gateway automatically publishes separate CloudWatch metrics for the canary stage.
This allows safe verification of the new version under production load.
3
Promote the canary release.
The new deployment becomes the active deployment for the stage, and the canary is disabled.
This completes the promotion to 100%100\% traffic with zero downtime and no additional stages to delete or manage.

Key Concept

API Gateway Canary Deployments
Estimated Time:2m 30s
Rate this question