AWS Certified Developer – Associate (DVA-C02) — Question 546
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?
Answer options
- A. Use API Gateway stage variables and create Lambda aliases to reference environment-specific resources.
- B. Use Amazon Elastic Container Service (Amazon ECS) to deploy the application to the environments.
- C. Duplicate the code for each environment. Deploy the code to a separate API Gateway stage.
- D. Use AWS Elastic Beanstalk to deploy the application to the environments.
Correct answer: A
Explanation
Using API Gateway stage variables combined with AWS Lambda aliases allows developers to route traffic to different versions of a Lambda function depending on the environment stage, minimizing management overhead. Replicating code across environments increases maintenance complexity, while migrating to ECS or Elastic Beanstalk introduces container or server management, defeating the purpose of a serverless architecture. This makes stage variables and aliases the most efficient solution with the least development effort.