A team runs a REST API on Amazon API Gateway with a single production stage that integrates with backend services. They want to release a new deployment to that stage but expose it to only five percent of production requests first, measuring the new behaviour against the existing one on the same stage before promoting it to all traffic. They want this handled by API Gateway itself rather than by duplicating the stage. Which approach achieves this?
- ACreate a second API Gateway stage for the new deployment and place an Amazon Route 53 weighted record in front of both stages, sending five percent of DNS resolutions to the new stage endpoint.
- BEnable a usage plan with a five percent throttle on the production stage so that only one in twenty requests reaches the new deployment while the rest are rejected and retried against the old behaviour.
- CEnable a canary release on the production stage and set the canary percentTraffic to five, so API Gateway sends five percent of requests to the new deployment and the rest to the current one on the same stage. Correct
- DDeploy the new version to a separate Lambda alias and attach a CodeDeploy canary deployment preference, letting CodeDeploy shift five percent of the Lambda traffic while the API Gateway stage stays unchanged.
Why A is wrong: A weighted Route 53 record can split traffic between two endpoints, but it requires duplicating the stage and shifts at DNS resolution granularity rather than per-request, which the team explicitly wanted to avoid.
Why B is wrong: A usage plan throttle limits request rate and returns throttling errors once exceeded; it does not split traffic between two deployments on a stage, so it cannot perform a percentage canary release.
Why C is correct: API Gateway stage canary settings let a stage hold both a current and a canary deployment, and percentTraffic controls the share routed to the canary, giving a per-request five percent split with no duplicate stage.
Why D is wrong: A Lambda CodeDeploy canary shifts traffic at the function alias, not at the API Gateway stage, so it does not provide the stage-level canary release the scenario asks API Gateway to perform.