DVA-C02 · Question #219
A developer is building a serverless application by using the AWS Serverless Application Model (AWS SAM). The developer is currently testing the application in a development environment. When the appl
The correct answer is A. Add a configuration file in TOML format to group configuration entries to every environment. Add. Option A is correct because AWS SAM natively supports a samconfig.toml configuration file that uses TOML format to define named configuration environments (e.g., [dev], [staging], [prod]), each with its own grouped parameters - you then deploy to a specific environment with sam d
Question
A developer is building a serverless application by using the AWS Serverless Application Model (AWS SAM). The developer is currently testing the application in a development environment. When the application is nearly finished, the developer will need to set up additional testing and staging environments for a quality assurance team. The developer wants to use a feature of the AWS SAM to set up deployments to multiple environments. Which solution will meet these requirements with the LEAST development effort?
Options
- AAdd a configuration file in TOML format to group configuration entries to every environment. Add
- BCreate additional AWS SAM templates for each testing and staging environment. Write a custom
- CCreate one AWS SAM configuration file that has default parameters. Perform updates to the
- DUse the existing AWS SAM template. Add additional parameters to configure specific attributes
How the community answered
(42 responses)- A83% (35)
- B10% (4)
- C5% (2)
- D2% (1)
Explanation
Option A is correct because AWS SAM natively supports a samconfig.toml configuration file that uses TOML format to define named configuration environments (e.g., [dev], [staging], [prod]), each with its own grouped parameters - you then deploy to a specific environment with sam deploy --config-env staging, requiring no custom scripting and minimal additional code.
Why the distractors are wrong:
- B requires maintaining separate SAM templates per environment plus custom deployment scripts, which multiplies maintenance burden - the opposite of least effort.
- C describes a single default-parameter config that still requires manual parameter overrides each deployment, losing the benefit of pre-grouped, named environments.
- D adds parameters to the template itself rather than using the config file's environment grouping feature, meaning you'd still need to pass different values manually per deploy rather than selecting a pre-configured environment by name.
Memory tip: Think "TOML = Table of Multiple Lands" - the TOML config file lets you set up each deployment "land" (environment) as its own named table, so you just point SAM at the right table and deploy, no extra scripts needed.
Topics
Community Discussion
No community discussion yet for this question.