DVA-C02 · Question #318
A company is building a serverless application on AWS. The application uses Amazon API Gateway and AWS Lambda. The company wants to deploy the application to its development, test, and production envi
The correct answer is A. Use API Gateway stage variables and create Lambda aliases to reference environment-specific. Option A is correct because API Gateway stage variables act like environment-specific configuration that can be passed to Lambda, and Lambda aliases (e.g., dev, test, prod) point to specific function versions - this lets you manage multiple environments with a single codebase and
Question
A company is building a serverless application on AWS. The application uses Amazon API Gateway and AWS Lambda. The company wants to deploy the application to its development, test, and production environments. Which solution will meet these requirements with the LEAST development effort?
Options
- AUse API Gateway stage variables and create Lambda aliases to reference environment-specific
- BUse Amazon Elastic Container Service (Amazon ECS) to deploy the application to the
- CDuplicate the code for each environment. Deploy the code to a separate API Gateway stage.
- DUse AWS Elastic Beanstalk to deploy the application to the environments.
How the community answered
(35 responses)- A77% (27)
- B9% (3)
- C3% (1)
- D11% (4)
Explanation
Option A is correct because API Gateway stage variables act like environment-specific configuration that can be passed to Lambda, and Lambda aliases (e.g., dev, test, prod) point to specific function versions - this lets you manage multiple environments with a single codebase and minimal additional infrastructure, which is the least-effort approach.
Option B is wrong because ECS uses containers, not serverless functions - it introduces significant operational overhead (task definitions, clusters, container images) that contradicts the serverless architecture already in place.
Option C is wrong because duplicating code across environments is the highest-effort option and creates maintenance nightmares - any bug fix must be applied to three separate codebases, violating the DRY principle and increasing development effort dramatically.
Option D is wrong because Elastic Beanstalk is designed for managing traditional server-based applications (EC2, load balancers), not serverless workloads - it adds unnecessary infrastructure complexity when the company has already chosen API Gateway + Lambda.
Memory tip: Think of it as "one function, many faces" - Lambda aliases give each environment its own named pointer to the right version, while API Gateway stage variables tell each stage which alias to call. If a question says "serverless + least effort + multiple environments," aliases and stage variables are almost always the answer.
Topics
Community Discussion
No community discussion yet for this question.