AWS Certified Developer – Associate (DVA-C02) — Question 466
A company has an Amazon API Gateway REST API that integrates with an AWS Lambda function. The API’s development stage references a development alias of the Lambda function named dev.
A developer needs make a production alias of the Lambda function named prod available through the API.
Which solution meets these requirements?
Answer options
- A. Create a new method on the API. Name the method production. Configure the method to include a stage variable that points to the prod Lambda function alias.
- B. Create a new method on the API. Name the method production. Configure an integration request on the API’s development stage that points to the prod Lambda function alias.
- C. Deploy the API to a new stage named production. Configure the stage to include a stage variable that points to the prod Lambda function alias.
- D. Deploy the API to a new stage named production. Configure an integration request on the API’s production stage that points to the prod Lambda function alias.
Correct answer: C
Explanation
Deploying the API to a dedicated production stage and using stage variables allows the API to dynamically route requests to the correct Lambda function alias (prod) based on the stage. Configuring stage variables is the AWS-recommended pattern for managing different backend environments (like dev and prod) without modifying the API's core resource structure. Other options incorrectly attempt to define environment-specific routing at the method level or configure integration requests directly on a stage without variables.