Courseiva
Understand IaC conceptshardMultiple ChoiceObjective-mapped

TF-004 Understand IaC concepts Practice Question

In Terraform, the `terraform plan` command compares the current state with the configuration. This is an example of which IaC principle?

⚠ Common exam trap

HashiCorp often tests the distinction between declarative (desired state enforcement) and imperative (step-by-step) approaches, and the trap here is that candidates confuse the `plan` command's output with a simple diff report rather than recognizing it as the core mechanism of Terraform's declarative state reconciliation model.

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

Desired state enforcement

The `terraform plan` command compares the current state (what is deployed) with the configuration (what is declared) and computes the changes needed to align the real-world infrastructure with the declared configuration. This is the essence of desired state enforcement: the tool continuously reconciles the actual state toward the user-defined desired state, rather than executing imperative steps. Option D is correct because Terraform's core loop—plan, apply, refresh—is built around this declarative, state-driven model.

Answer analysis

Option-by-option breakdown

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

  • Version control integration

    Why it's wrong here

    While Terraform configurations are commonly stored and managed within version control systems like Git, the `terraform plan` command's core function is not version control integration itself. Its purpose is to analyze infrastructure changes based on the configuration files and the current state, independent of how those files are tracked or committed externally. Version control manages the configuration source, whereas `terraform plan` interprets it.

  • Continuous delivery

    Why it's wrong here

    Continuous Delivery (CD) is a comprehensive software engineering practice focused on automating the entire release process, from code commit to production deployment. Although `terraform plan` is an essential step often integrated into CD pipelines to preview infrastructure changes before deployment, it represents only one specific action within the broader CD workflow. It does not encompass the full scope of automated testing, artifact management, or deployment orchestration inherent to continuous delivery.

  • Modular architecture

    Why it's wrong here

    Terraform's modular architecture is a design principle that promotes code reusability and organization by encapsulating infrastructure components into reusable units. This helps manage complexity and maintain consistency across projects. However, the `terraform plan` command's primary role is to compare the current infrastructure state with the *entire* desired configuration, regardless of whether that configuration is structured using modules, to determine necessary changes, not to enforce or directly manage module structure.

  • Desired state enforcement

    Why this is correct

    The `terraform plan` command is central to desired state enforcement in Terraform. It meticulously compares the infrastructure's current state, as recorded in the state file and potentially observed live, against the desired configuration defined in the Terraform files. The resulting plan details all the actions (creations, updates, destructions) required to reconcile any discrepancies, thereby showing precisely what is needed to achieve the desired infrastructure state.

About these practice questions

Courseiva writes every TF-004 question from scratch — 428 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This TF-004 practice question is part of Courseiva's free HashiCorp 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 TF-004 exam.