A company uses API Gateway to invoke a Lambda function. There are separate Lambda versions for PROD and DEV, and each has an alias pointing to its version. API Gateway has one stage pointing to the PROD alias. The company wants API Gateway to expose both PROD and DEV Lambda versions simultaneously and distinctly. Which approach satisfies this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Use an API Gateway stage variable that references the Lambda function alias. Republish PROD and create a new stage for DEV. Create stage variables for the PROD and DEV stages and set each stage variable to the corresponding Lambda function alias..
Why this is the answer
The correct approach is to use API Gateway stage variables. By creating a new API Gateway stage for DEV and configuring a stage variable in each stage (PROD and DEV) to point to its respective Lambda alias, you can expose both versions simultaneously and distinctly. API Gateway will then use the stage variable to determine which Lambda alias to invoke based on the stage being accessed. Incorrect options: Lambda authorizers are for authentication/authorization, not for routing to different Lambda versions. Gateway responses are for customizing error responses, not for routing requests to different backends. Environment variables in API Gateway are typically used for configuration within the API Gateway itself or passed to the backend, but they don't directly control which Lambda alias a stage invokes in this manner. Stage variables are specifically designed for stage-specific configurations like backend endpoints.
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