Q12 — AWS DVA-C02 Ch.1
Question 12 of 100 | ← Chapter 1
A company has an AWS Lambda function that processes incoming requests from an Amazon API Gateway API. The API invokes the Lambda function using a Lambda alias. A developer updated the Lambda function code to handle more detailed information related to incoming requests. The developer wants to deploy the new Lambda function for testing by other developers without impacting customers using the API. Which solution meets these requirements with the lowest operational overhead?
- A. Create a new version of the Lambda function. Create a new stage in API Gateway and integrate it with the new Lambda version. Use the new API Gateway stage to test the Lambda function. ✓
- B. Update the existing Lambda alias used by API Gateway to a weighted alias. Add the new Lambda version as an additional Lambda function with a weight of 10%. Use the existing API Gateway stage for testing.
- C. Create a new version of the Lambda function. Create and deploy a second Lambda function to filter incoming requests from API Gateway. If the filter Lambda detects a test request, it invokes the new Lambda version; otherwise, it invokes the old version. Update the API Gateway API to use the filter Lambda function.
- D. Create a new version of the Lambda function. Create a new API Gateway API for testing purposes. Update the new API to integrate with the new Lambda version. Use the new API for testing.
Correct Answer: A. Create a new version of the Lambda function. Create a new stage in API Gateway and integrate it with the new Lambda version. Use the new API Gateway stage to test the Lambda function.
Explanation
Option A creates a new Lambda version and a new API Gateway stage integrated with that version, enabling isolated testing without affecting production traffic. It incurs minimal operational overhead—only requiring a new deployment stage and integration update. Option B introduces weighted routing, which adds complexity in monitoring and risk of unintended production impact. Option C adds an extra Lambda layer, increasing architecture complexity and management overhead. Option D duplicates the entire API Gateway API, raising operational costs and maintenance burden. Thus, Option A is optimal.