easyMultiple ChoiceObjective-mapped
CV0-004 Practice Question: Is deploying a new application using…
An organization is deploying a new application using Infrastructure as Code (IaC) with Terraform. The development team needs to ensure that the same configuration is applied consistently across development, staging, and production environments. What is the best practice for managing these Terraform configurations?
⚠ Common exam trap
It's easy for candidates to confuse using variable files (Option C) with proper environment isolation, not realizing that Terraform workspaces or separate directories are required to manage distinct state files and prevent cross-environment interference.
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
✓
Maintain separate Terraform workspaces or directories for each environment.
Using separate Terraform workspaces or directories for each environment enforces isolation of state files and configuration, preventing accidental cross-environment changes. This approach aligns with Infrastructure as Code best practices by allowing environment-specific variables and resources while maintaining a single source of truth for the core configuration.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Hardcode environment-specific values within the main configuration file.
Why it's wrong here
Not portable and difficult to maintain.
- ✗
Manually update the configuration for each environment before deployment.
Why it's wrong here
Contrary to Infrastructure as Code principles.
- ✗
Use a single Terraform configuration with different variable files for each environment.
Why it's wrong here
Risk of workspace pollution and hard to manage dependencies.
- ✓
Maintain separate Terraform workspaces or directories for each environment.
Why this is correct
Best practice for isolation and consistency.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CV0-004 question from scratch — 977 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CV0-004 practice question is part of Courseiva's free CompTIA 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 CV0-004 exam.