
Answer-first summary for fast verification
Answer: Adopt multiple API Gateway stages, with a unique Lambda function for each environment, leveraging stage variables to direct traffic to the correct Lambda function.
The best solution is to use multiple stages in API Gateway and create a Lambda function for each environment. This approach ensures clear separation of environments and reduces the risk of accidental changes impacting production. API Gateway stage variables can be configured to route traffic to the appropriate Lambda function for the given environment, providing further isolation and manageability. Options A and D, which use a single stage, and option B, which uses a single Lambda function for all environments, do not provide this level of separation and isolation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
An ecommerce application utilizes Amazon API Gateway and AWS Lambda. What is the recommended approach for testing the application in a separate, monitored environment before production deployment?
A
Implement a single API Gateway stage with distinct Lambda functions for each environment, using query parameters to select the appropriate function.
B
Utilize multiple API Gateway stages, employing one Lambda function across all environments, differentiated by environment variables within the Lambda code.
C
Adopt multiple API Gateway stages, with a unique Lambda function for each environment, leveraging stage variables to direct traffic to the correct Lambda function.
D
Employ a single API Gateway stage, directing environment-specific traffic through query parameters, with the Lambda function containing conditional code blocks based on the environment indicated by the parameter.