DVA-C02 Deployment Practice Question
A developer needs different configuration values for dev, test, and prod in the same SAM template. Which feature is suitable?
⚠ Common exam trap
Candidates often think hardcoding ARNs or using separate root accounts is simpler, but the exam tests knowledge of AWS-recommended patterns like parameter overrides and multi-account strategies using AWS Organizations, not root accounts.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Parameters and environment-specific parameter overrides
AWS SAM supports Parameters and environment-specific parameter overrides, allowing you to define a single template and supply different configuration values (e.g., database URLs, API keys) for dev, test, and prod environments at deployment time. This is achieved by passing a JSON or YAML file with the `--parameter-overrides` flag in the `sam deploy` command, or by using the `parameters` section in a `samconfig.toml` file. This approach avoids duplicating templates and keeps infrastructure-as-code DRY and maintainable.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Parameters and environment-specific parameter overrides
Why this is correct
This approach is highly effective for managing environment-specific configurations. By defining parameters in Infrastructure as Code (IaC) templates, such as AWS CloudFormation, developers can specify different values for resources like database endpoints, API keys, or instance types depending on the target environment (dev, test, production). Parameter overrides allow the same template to be deployed multiple times with distinct configurations, ensuring consistency in infrastructure definition while adapting to environmental needs.
- ✗
Hardcoded ARNs in every function
Why it's wrong here
Hardcoding Amazon Resource Names (ARNs) directly within application code or infrastructure templates is an anti-pattern for managing environment-specific configurations. This method necessitates manual code changes for each environment, leading to increased risk of errors, reduced reusability, and a cumbersome deployment process. It tightly couples the application logic to specific resource identifiers, making it difficult to promote code through different stages without modification.
- ✗
One AWS root account per environment
Why it's wrong here
Utilizing one AWS root account per environment is a severe security anti-pattern and does not directly address the need for different configuration values. Root accounts possess unrestricted access to all resources within an AWS account and should only be used for a very limited set of tasks, such as initial account setup. This approach introduces significant security risks and does not provide a scalable or secure mechanism for managing application-level configuration differences between environments.
- ✗
Disabling stack updates
Why it's wrong here
Disabling stack updates prevents any modifications to the deployed AWS resources, including necessary configuration changes or bug fixes. While it might prevent unintended changes, it completely hinders the ability to evolve or adapt an environment, which is crucial during development and testing phases. This approach does not provide a mechanism for applying *different* configuration values; instead, it locks down the existing configuration, making it counterproductive for managing dynamic environments.
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.