Question #938
A developer modifies an AWS Lambda function integrated with an Amazon API Gateway API, which serves as the backend for a mobile application. The developer needs to validate the updated Lambda function's functionality without impacting the current production traffic. Which approach meets these requirements with the HIGHEST operational efficiency?
Implement a canary release strategy for the existing API stage. Deploy the updated Lambda function gradually and monitor using the same API endpoint.
Deploy the updated Lambda function to the existing API stage with a new version. Use the existing API URL with a header to route to the new version.
Create a new API stage in API Gateway and configure stage variables to point to the updated Lambda function. Test using the new stage's dedicated URL.
Provision a new API Gateway and Lambda function through AWS CloudFormation, replicating the production setup. Test using the new stack's API endpoint.
Explanation
Option C is correct because creating a new API Gateway stage with stage variables enables the developer to test the updated Lambda function in isolation using a dedicated URL. This approach avoids impacting production traffic since the existing stage remains untouched. Stage variables allow the new stage to reference the updated Lambda function's ARN, ensuring safe testing.
Other options are less efficient:
- A (Canary release) risks exposing production traffic to untested changes.
- B (Header-based routing) requires client-side changes and risks accidental production impact.
- D (Full stack replication) is operationally heavy and unnecessary.
Key points: API Gateway stages provide isolated environments; stage variables enable versioning without code changes; testing via a dedicated URL ensures zero impact on production.
Answer
The correct answer is: C