AWS Certified Developer – Associate / Question #861 of 557

Question #861

A company is deploying a serverless application on AWS using Amazon API Gateway and AWS Lambda. They need to manage deployments across development, testing, and production environments, ensuring each environment uses specific configurations without modifying the application code. Which solution requires the LEAST development effort?

A

Utilize API Gateway stage variables and configure Lambda function aliases to point to environment-specific resources.

B

Deploy the application using AWS Fargate with separate task definitions for each environment.

C

Maintain separate API Gateway APIs and Lambda functions for each environment, deploying them individually.

D

Use AWS CloudFormation templates to provision distinct stacks for each environment.

Explanation

Answer A is correct because:
- API Gateway Stage Variables: Allow environment-specific configurations (e.g., Lambda ARNs) to be set per stage (dev, test, prod) without code changes.
- Lambda Aliases: Enable pointing to environment-specific Lambda versions (e.g., dev-v1, prod-v1), decoupling deployments from environment configurations.

Other options are less efficient:
- B (Fargate): Requires container orchestration, separate task definitions, and is unrelated to the serverless setup.
- C (Separate APIs/Lambda): Increases overhead with redundant deployments and code duplication.
- D (CloudFormation Stacks): Involves managing multiple templates/parameters, adding complexity.

Key Points:
- Use stage variables and aliases for environment-specific configurations.
- Avoid redundant deployments and code changes.
- Leverage native AWS serverless features for minimal effort.

Answer

The correct answer is: A