Courseiva
Use the core Terraform workflowmediumMultiple SelectObjective-mapped

TF-004 Use the core Terraform workflow Practice Question

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

⚠ Common exam trap

HashiCorp often tests the distinction between commands that are part of the essential three-step workflow (init, plan, apply) versus commands that are useful but optional, leading candidates to mistakenly include `terraform validate` or `terraform fmt` as core workflow steps.

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 plan

The core Terraform workflow consists of three main steps: `terraform init` to initialize the working directory, `terraform plan` to preview changes, and `terraform apply` to execute those changes. Option B (`terraform plan`) is correct because it creates an execution plan showing what actions Terraform will take to reach the desired state defined in configuration files. Option D (`terraform apply`) is correct because it applies the changes required to reach the desired state, either by using a previously generated plan or by creating a new plan and prompting for approval.

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

    terraform fmt is a utility command used to rewrite Terraform configuration files to a canonical format and style. While highly recommended for maintaining consistency and readability across a team's codebase, it does not directly interact with the infrastructure state or define the lifecycle of resources. Therefore, terraform fmt is considered a development aid rather than an integral step in the core workflow of provisioning or managing infrastructure.

  • terraform plan

    Why this is correct

    terraform plan is a fundamental command in the core Terraform workflow, serving as the crucial second step after initialization. This command generates an execution plan, detailing exactly what actions Terraform will perform to achieve the desired state defined in the configuration files. It allows users to review proposed changes—such as creating, updating, or destroying resources—before any actual modifications are made to the real infrastructure, ensuring predictability and preventing unintended consequences.

  • terraform validate

    Why it's wrong here

    terraform validate performs checks on the configuration files to ensure they are syntactically valid and internally consistent, verifying correct attribute names, types, and module usage. While essential for catching errors early in the development cycle, it does not interact with the remote state or propose infrastructure changes. Consequently, terraform validate is considered a preparatory command, distinct from the core workflow steps that involve interacting with the actual infrastructure.

  • terraform apply

    Why this is correct

    terraform apply is the critical final step in the core Terraform workflow, responsible for executing the actions proposed in a terraform plan to provision or modify infrastructure. This command prompts for confirmation (unless auto-approved) and then makes the necessary API calls to cloud providers or other services to create, update, or delete resources as defined in the configuration. It brings the real-world infrastructure into alignment with the desired state specified in the Terraform code.

  • terraform destroy

    Why it's wrong here

    terraform destroy is a command used to tear down all resources managed by a given Terraform configuration, effectively reversing the provisioning process. While it interacts with infrastructure, it represents a distinct and often irreversible workflow for decommissioning resources, rather than being part of the routine creation and management cycle. The core workflow focuses on bringing infrastructure to a desired state, whereas destroy explicitly removes that infrastructure.

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.