An e-commerce application uses Amazon API Gateway with AWS Lambda backend functions. The company needs a separate, observable test environment to validate code before promoting it to production. Which design meets this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Use multiple API Gateway stages. Deploy a separate Lambda function per environment and configure API Gateway stage variables to route each stage to the appropriate Lambda function..
Why this is the answer
Using multiple API Gateway stages (e.g., dev, test, prod) allows for independent deployment and testing environments. Deploying a separate Lambda function for each environment ensures isolation, preventing changes in one environment from affecting others. Configuring API Gateway stage variables to point each stage to its corresponding Lambda function provides a clean, configurable routing mechanism. This approach offers clear separation, independent observability, and simplifies promotion from test to production. Incorrect options: Using a single API Gateway stage with query parameters or conditional code in a single Lambda function complicates routing, makes observability difficult, and tightly couples environments, increasing the risk of unintended side effects. Using multiple stages with a single Lambda function and conditional code paths within it violates the principle of least privilege and makes independent testing and debugging challenging, as all stages share the same underlying code.
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