nerdexam
Amazon

DVA-C02 · Question #631

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. Deploying API Gateway and Lambda to multiple environments is most efficiently done using stage variables and Lambda aliases, which avoid code duplication and infrastructure sprawl.

Submitted by ashley.k· Mar 5, 2026Deployment

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 ECS to deploy the application to the environments.
  • 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

(40 responses)
  • A
    75% (30)
  • B
    5% (2)
  • C
    8% (3)
  • D
    13% (5)

Why each option

Deploying API Gateway and Lambda to multiple environments is most efficiently done using stage variables and Lambda aliases, which avoid code duplication and infrastructure sprawl.

AUse API Gateway stage variables and create Lambda aliases to reference environment-specificCorrect

API Gateway stage variables act as environment-specific configuration pointers (e.g., pointing to dev, test, or prod Lambda aliases), and Lambda aliases pin stages to specific function versions, enabling a single deployment pipeline to manage all environments without duplicating code or infrastructure.

BUse Amazon ECS to deploy the application to the environments.

Amazon ECS is a container orchestration service that introduces significant infrastructure management overhead not appropriate for a serverless Lambda-based application.

CDuplicate the code for each environment. Deploy the code to a separate API Gateway stage.

Duplicating code for each environment multiplies maintenance burden significantly; any change must be applied to every copy separately, which is the highest development effort option.

DUse AWS Elastic Beanstalk to deploy the application to the environments.

AWS Elastic Beanstalk manages EC2-based or container applications and is not the appropriate tool for a serverless API Gateway and Lambda architecture.

Concept tested: API Gateway stage variables and Lambda aliases for multi-environment deployment

Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/aws-api-gateway-stage-variables-reference.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice