A developer is using AWS SAM to build a serverless app and currently tests in a development environment. They need to add testing and staging environments for QA and want to use an AWS SAM feature that supports deploying to multiple named environments with minimal effort. Which approach is the least development-intensive?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a TOML-format SAM configuration file that groups settings per environment, add a table for each test/staging environment, and deploy using sam deploy with the --config-env flag for each environment..
Why this is the answer
The AWS SAM CLI supports environment-specific configurations using a TOML-format samconfig.toml file. This allows developers to define different parameter values, S3 buckets, and other settings for multiple named environments (e.g., test, staging) within a single configuration file. Deploying with sam deploy --config-env <environmentname automatically applies the settings for that specific environment, minimizing manual effort and script writing. Creating separate SAM templates for each environment introduces redundancy and makes maintenance difficult. Using a single SAM configuration file with --parameter-overrides is possible but less organized and more prone to errors than a dedicated samconfig.toml for multiple environments. Adding parameters to the existing SAM template and deploying with sam deploy still requires manually specifying all parameters for each environment, which is more development-intensive than using samconfig.toml.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed