Q77 — AWS DVA-C02 Ch.1
Question 77 of 100 | ← Chapter 1
A developer is building a serverless application using the AWS Serverless Application Model (AWS SAM). The developer is currently testing the application in a development environment. As the application nears completion, the developer needs to set up additional test and pre-production environments for quality assurance. The developer wants to use an AWS SAM feature to deploy to each environment. Which solution meets these requirements with the least development effort?
- A. Add a TOML-formatted configuration file grouping configuration entries per environment. Add a table for each test and pre-production environment. Deploy updates to each environment using the sam deploy command with the --config-env flag corresponding to that environment. ✓
- B. Create additional AWS SAM templates for each test and pre-production environment. Write a custom shell script using the sam deploy command with the --template-file flag to deploy updates to each environment.
- C. Create an AWS SAM configuration file with default parameters. Use the --parameter-overrides flag in the AWS SAM CLI to override parameters for test and pre-production environments.
- D. Use the existing AWS SAM template. Add extra parameters to configure environment-specific attributes for serverless functions and database table resources. Deploy updates to test and pre-production environments using the sam deploy command.
Correct Answer: A. Add a TOML-formatted configuration file grouping configuration entries per environment. Add a table for each test and pre-production environment. Deploy updates to each environment using the sam deploy command with the --config-env flag corresponding to that environment.
Explanation
Option A is correct: organizing configuration by environment in a TOML file and deploying with --config-env minimizes development effort while maintaining clarity and maintainability.