A developer wants to test optimized changes to a Lambda that backs a REST API in API Gateway by routing a small percentage of live traffic to the updated code without changing the API URL. Which steps accomplish this?
Choose an answer
Tap an option to check your answer.
Correct answer: Create an alias for the $LATEST Lambda version and point the API Gateway integration to that alias. Publish the optimized Lambda code. On the production API Gateway stage, configure a canary and set the percentage of traffic to route to the canary..
Why this is the answer
The correct approach involves using a Lambda alias and API Gateway canary deployments. First, create an alias for your Lambda function and configure the API Gateway integration to use this alias. This provides a stable entry point. When you publish optimized Lambda code, it becomes the new $LATEST version. To perform a canary release, you configure the API Gateway stage to use a canary deployment. You then update the alias to include the new $LATEST version with a weighted routing configuration, directing a small percentage of traffic to the optimized code. This allows for controlled testing without changing the API URL. Incorrect options: Updating the API Gateway integration to point directly to a new version or $LATEST without an alias or canary setup would immediately switch all traffic, not allowing for a phased rollout. Deploying a new API Gateway stage would create a new URL, which is contrary to the requirement of not changing the API URL. The first incorrect option describes a process that mixes up the order of operations and misuses versions/aliases with canary stages. Canary deployments in API Gateway are typically managed by configuring the stage itself to route traffic between a base deployment and a canary deployment, often leveraging Lambda aliases for the underlying function versions.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed