A REST service uses API Gateway with Lambda integration and needs to support multiple versions for testing. What is the BEST approach to run different versions concurrently for testing?
Choose an answer
Tap an option to check your answer.
Correct answer: Deploy each API version as a separate stage with its own endpoint and use stage variables for additional context..
Why this is the answer
Deploying each API version as a separate stage is the best approach because API Gateway stages are designed for managing different deployment versions of an API. Each stage gets its own unique endpoint, allowing concurrent testing of multiple versions without interference. Stage variables can then be used to pass version-specific configuration or context to the backend Lambda functions, such as different database endpoints or environment variables. Using an X-Version header would require custom routing logic within the Lambda function itself, which is less efficient and harder to manage than API Gateway's built-in staging. An API Gateway Lambda authorizer is for authentication and authorization, not for routing different API versions. An API Gateway resource policy controls access, not versioning or routing.
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