Courseiva

TF-004 Understand Terraform basics Practice Question

A developer new to Terraform writes a configuration with a provider block, a resource block, and an output block. They run a single command that initializes the working directory, downloads the provider plugin, and prepares the backend. Which command did they run?

⚠ Common exam trap

Many candidates confuse initialization with planning or applying, when only init prepares the working directory and downloads providers.

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

✓

terraform init

terraform init is the initialization command that downloads provider plugins, sets up the backend, and installs modules. It must be run before plan, apply, or validate in a new working directory. The other commands operate on an already initialized directory and will fail if initialization has not occurred.

Answer analysis

Option-by-option breakdown

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

  • ✓

    terraform init

    Why this is correct

    terraform init prepares a working directory by downloading required provider plugins, initializing the backend, and installing modules. It must be run before plan or apply in a new directory or after changing providers or backend configuration. It reads the configuration to determine which providers and versions are needed. This matches the scenario exactly.

  • ✗

    terraform plan

    Why it's wrong here

    terraform plan creates an execution plan by comparing configuration and state, but it does not download providers or initialize the backend. If the working directory has not been initialized, plan fails with an error about missing provider plugins or uninitialized backend. It assumes initialization already happened. Therefore it cannot be the command that prepares the directory.

  • ✗

    terraform validate

    Why it's wrong here

    terraform validate checks whether a configuration is syntactically valid and internally consistent, but it does not download providers or set up the backend. It can run only after init because it relies on provider schemas. It is a static check, not an initialization step, so it does not match the described behavior.

  • ✗

    terraform apply

    Why it's wrong here

    terraform apply executes the actions proposed in a plan to reach the desired state. It does not download providers or initialize the backend; it requires a prior init. Running apply in an uninitialized directory produces an error instructing the user to run init first. It also may prompt for approval unless auto-approve is set, which is unrelated to initialization.

About these practice questions

Courseiva writes every TF-004 question from scratch — 434 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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official HashiCorp exam blueprint

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.