Courseiva
Understand IaC conceptseasyMultiple ChoiceObjective-mapped

TF-004 Understand IaC concepts Practice Question

A team is evaluating Terraform and Ansible for infrastructure provisioning. They note that Terraform describes the desired end state, while Ansible defines steps to reach that state. This difference is best described as:

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

Declarative vs imperative

The difference between declarative and imperative paradigms is key: Terraform is declarative (you specify the desired end state, and Terraform figures out how to achieve it), while Ansible is imperative (you specify each step to reach the state). Option B (client-server vs agentless) refers to architecture, option C (immutable vs mutable) refers to update strategies, and option D (push vs pull) refers to deployment methods. Therefore, option A is correct.

Answer analysis

Option-by-option breakdown

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

  • Declarative vs imperative

    Why this is correct

    Terraform's configuration files are fundamentally declarative, meaning they specify the desired end state of infrastructure resources without detailing the exact procedural steps to achieve it. In contrast, Ansible typically employs an imperative approach, where playbooks define a precise sequence of commands and tasks that must be executed in a specific order to transition the infrastructure to a particular configuration. This distinction in how desired outcomes are expressed is a primary differentiator when evaluating these infrastructure as code tools.

  • Client-server vs agentless

    Why it's wrong here

    While Terraform generally operates in a client-only mode, interacting directly with cloud provider APIs, and Ansible is agentless, connecting to target nodes via SSH or WinRM, this describes their underlying architectural communication model. This architectural difference, concerning how the tools interact with the infrastructure, is distinct from the fundamental paradigm of how they define and manage changes to that infrastructure, which is the core focus of the question.

  • Immutable vs mutable

    Why it's wrong here

    Immutable infrastructure refers to the practice of replacing existing servers or components with new ones whenever a change is needed, rather than modifying them in place, while mutable infrastructure allows for in-place updates. Although Terraform can be used to implement immutable infrastructure patterns (e.g., by provisioning new instances and destroying old ones), and Ansible can manage mutable infrastructure, this concept describes an operational strategy or outcome of infrastructure management, not the inherent language style or core operational paradigm of the tools themselves.

  • Push vs pull

    Why it's wrong here

    Push-based configuration management, exemplified by Ansible, involves a central controller initiating connections to target nodes and "pushing" configurations or commands to them. Conversely, pull-based systems have target nodes periodically "pulling" their desired state or configuration from a central server. While Terraform generally operates in a push-like manner (applying changes directly to APIs), this distinction describes the delivery mechanism of configuration, not the fundamental way the infrastructure state is defined or managed by the tool's core language.

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.