Q58 — AWS DVA-C02 Ch.3

Question 58 of 100 | ← Chapter 3

A company is developing a mobile application that uses an Amazon API Gateway API. The application uses AWS Lambda as its backend. Before releasing code to production, the company wants to test the code in a dedicated, closely monitored test environment. Which solution meets these requirements?

Correct Answer: C. Use multiple stages in API Gateway. Create a separate Lambda function for each environment. Configure API Gateway stage variables to route traffic to the Lambda function for that environment.

Explanation

Option C is correct. Multiple API Gateway stages provide clear, isolated, and independently configurable environments (e.g., 'test' and 'prod'). Deploying dedicated Lambda functions per environment ensures strict separation of concerns, independent scaling, and simplified debugging and monitoring. Stage variables enable clean, declarative routing without embedding environment logic in client requests or Lambda code. Option A relies on client-side query parameters, introducing coupling and security risk. Option B centralizes logic in one function, increasing complexity and reducing observability. Option D mixes environment routing logic into Lambda code, violating separation of concerns and hindering maintainability. Thus, Option C delivers the cleanest, most scalable, and operationally sound architecture.