How to Make a Lambda Production Alias Available Through API Gateway?
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?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The exam tests the stage-variable pattern for routing Lambda aliases per environment, and the trap is choosing an option that hard-codes the alias directly in the integration request instead of using a stage variable.
API Gateway stage variables let a single REST API integration point to different Lambda function aliases per deployment stage. The community unanimously (100% of votes) agrees that deploying the API to a new production stage with a stage variable referencing the prod alias is the correct solution.
Option D: deploying to a production stage but directly editing the integration request to point at the prod alias. This hard-codes the alias, breaks environment separation, and requires manual integration changes in every stage instead of letting stage variables switch aliases dynamically.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
AWS's recommended pattern for multi-environment APIs is to reference a Lambda alias through a stage variable. Deploying the REST API to a new stage named "production" and defining a stage variable (for example, lambdaAlias = prod) used in the integration URI (arn:aws:lambda:region:account:function:fn:${stageVariables.lambdaAlias}) exposes the prod alias through that stage. This keeps the dev and prod environments isolated while reusing the same API definition and integration. All 100% of community votes selected C.Why the Other Options Are Wrong
Options A and B create a new "method" named production, but API methods are HTTP verbs (GET, POST, etc.), not environment names, so this concept is invalid. Option B also hard-codes the prod alias into the development stage's integration request, which would modify the dev environment rather than create a production one. Option D creates the correct production stage but configures the integration request directly instead of using a stage variable, which commenters flagged as not ideal because it requires manually changing the integration in each stage and defeats dynamic environment management.Community Comment Notes
Every comment supports C. Comment [2] explains that D is wrong because "directly configuring the integration request on the production stage is not ideal" and that stage variables let you "manage different environments without manually changing the integration in each stage." Comment [3] agrees the configuration "should be done using a stage variable, not by configuring the integration request directly." Comment [1] adds that this approach "separates environments and provides flexibility for future alias updates."Official Reference
Exam Strategy
Whenever a question pairs Lambda aliases with API Gateway stages, choose the option that deploys to a new stage and uses a stage variable in the integration URI. Treat options that create methods named after environments or that edit integration requests directly as distractors. Memorize the pattern arn:aws:lambda:region:account:function:name:${stageVariables.lambdaAlias}.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →