Courseiva
hardMultiple Select

CV0-004 Practice Question: Which THREE of the following are best practices…

Which THREE of the following are best practices when deploying a cloud application using Infrastructure as Code (IaC)? (Choose three.)

⚠ Common exam trap

CompTIA often tests the distinction between mutable and immutable infrastructure, and the trap here is that candidates may think manual tuning (Option D) is acceptable for performance optimization, but it violates the core IaC principle of idempotent, automated deployments.

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

✓

Store IaC templates in a version control system.

Option A is correct because storing IaC templates in a version control system (e.g., Git) provides change history, peer review via pull requests, rollback capability, and auditability, which are foundational to reliable, repeatable deployments. Option B is correct because decomposing complex deployments into reusable modules (e.g., Terraform modules or CloudFormation nested stacks) reduces duplication, enforces consistency, and makes templates easier to test and maintain. Option E is correct because immutable infrastructure patterns—replacing rather than mutating running resources, often via new machine images or fresh stack deployments—eliminate configuration drift and make rollbacks deterministic. Option C is not appropriate because embedding credentials directly in templates exposes secrets in version control and logs; secrets should be referenced from a secrets manager or parameter store. Option D is not appropriate because manually modifying resources after deployment creates configuration drift, breaks reproducibility, and means the IaC templates no longer reflect the actual environment.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Store IaC templates in a version control system.

    Why this is correct

    Version control gives every template change an auditable history and enables rollback, peer review and branching. This directly satisfies the reproducibility and traceability that Infrastructure as Code demands, since environments can be rebuilt from a known, reviewed commit rather than undocumented manual edits.

  • ✓

    Break down complex deployments into reusable modules.

    Why this is correct

    Modular decomposition lets teams compose complex environments from tested, parameterised building blocks instead of duplicating monolithic templates. This satisfies the maintainability and reuse requirement of Infrastructure as Code, reducing drift and errors when the same pattern is deployed across multiple environments.

  • ✗

    Embed credentials directly in the IaC templates.

    Why it's wrong here

    Embedded credentials sit in plaintext in templates and version control, exposing secrets to anyone with repository read access and preventing rotation. It is tempting because it makes templates self-contained and immediately runnable; it would be acceptable only for throwaway sandboxes with no real secrets.

  • ✗

    Manually modify resources after deployment to tune performance.

    Why it's wrong here

    Manual modifications cause configuration drift.

  • ✓

    Use immutable infrastructure patterns where possible.

    Why this is correct

    Immutable patterns replace rather than mutate running instances, so each deployment produces an identical, known-good artefact. This satisfies the consistency and rollback requirement of Infrastructure as Code, eliminating configuration drift caused by in-place patching of long-lived servers.

About these practice questions

One of 834 original CV0-004 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 →

How Courseiva writes practice questions · Editorial policy

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.