Courseiva
Use the core Terraform workfloweasyMultiple SelectObjective-mapped

TF-004 Use the core Terraform workflow Practice Question

Which TWO commands are part of the core Terraform workflow? (Choose two.)

⚠ Common exam trap

HashiCorp often tests the distinction between commands that are part of the core provisioning workflow (init, plan, apply) versus auxiliary commands like `fmt`, `console`, or `get`, which are used for formatting, debugging, or module management but not for the fundamental plan-apply cycle.

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 correct because it initializes a working directory containing Terraform configuration files, downloading and installing the required providers and modules. This is the first command in the core Terraform workflow, which follows the sequence: init, plan, apply. Without `init`, subsequent commands like `plan` or `apply` will fail due to missing provider plugins and backend 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.

  • terraform fmt

    Why it's wrong here

    The `terraform fmt` command is a utility designed to automatically rewrite Terraform configuration files to a canonical format and style. While highly recommended for maintaining code consistency, readability, and collaboration within a team, it is an auxiliary command that does not directly interact with the Terraform state, communicate with cloud providers, or provision infrastructure. Therefore, it is not considered a fundamental step in the core workflow of deploying or managing resources.

  • terraform init

    Why this is correct

    The `terraform init` command is a foundational and essential first step in the core Terraform workflow, preparing the working directory for subsequent operations. It downloads and installs necessary provider plugins, initializes the backend for state storage, and retrieves any required modules. This command establishes the environment crucial for Terraform to understand and interact with the desired infrastructure, making it indispensable before planning or applying changes.

  • terraform console

    Why it's wrong here

    The `terraform console` command provides an interactive command-line interface for evaluating expressions and inspecting the current state of Terraform variables, outputs, and resources. It serves as a powerful debugging and exploration tool, allowing users to test logic or understand resource attributes dynamically. However, `terraform console` does not perform any infrastructure provisioning, planning, or destruction, thus placing it outside the core workflow steps that directly manage the infrastructure lifecycle.

  • terraform apply

    Why this is correct

    The `terraform apply` command is a critical component of the core Terraform workflow, responsible for executing the actions proposed in a Terraform plan to provision or update real-world infrastructure. It reconciles the desired state defined in the configuration files with the current state of the infrastructure, making the necessary changes to cloud resources. This command is the ultimate step that translates configuration into deployed infrastructure, persisting the updated state for future operations.

  • terraform get

    Why it's wrong here

    The `terraform get` command is specifically used to download and update modules referenced in the Terraform configuration. While module management is crucial for complex projects, `terraform get` is largely integrated into or superseded by `terraform init` for most modern workflows. It is not considered a standalone core workflow command because `init` comprehensively handles all necessary module and provider downloads as part of its initial setup process, making `get` redundant in typical usage.

About these practice questions

This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.