Terraform 004 workflow explained

Updated November 23, 2026

Objectives 1 to 3 of the Terraform Associate (004) cover what infrastructure as code is, how providers and state fit together and the core command workflow. Together they are the base for everything else: you write configuration, run init, plan and apply, and Terraform records what it built in state. HashiCorp publishes no weights, but these three objectives hold 14 of the 37 sub-objectives, so they deserve solid practice.

Objective 1: Infrastructure as Code

IaC means describing infrastructure in files that are versioned, reviewed and reapplied, instead of clicking in a console. The benefits to know are repeatability, fewer manual errors, a history of changes, easier review and the ability to rebuild environments. Terraform is declarative: you describe the desired end state and it works out the steps. It is also service-agnostic, because providers let one workflow manage several clouds and other services, which is how it supports multi-cloud and hybrid setups.

Objective 2: Providers and state

A provider is a plugin that translates resource blocks into API calls for a platform. You declare which providers you need and their version constraints in a required_providers block, and terraform init downloads them and records the chosen versions in the dependency lock file. Multiple providers can appear in one configuration, and aliases let you use two configurations of the same provider, for example two regions.

State is Terraform’s record of the real objects it manages. It maps configuration to real resources and stores their attributes, which lets Terraform calculate a plan by comparing configuration, state and reality.

Objective 3: The core workflow

CommandWhat it doesChanges infrastructure?
terraform initSets up the working directory: downloads providers and modules, configures the backendNo
terraform validateChecks syntax and internal consistencyNo
terraform fmtRewrites files to canonical styleNo
terraform planShows proposed changesNo
terraform applyExecutes the plan, after approval unless auto-approvedYes
terraform destroyRemoves everything the configuration managesYes

Know the loop: write, plan, apply. Know that validate does not contact providers to check real-world values, and that a saved plan file lets you apply exactly what was reviewed. Plan symbols matter: a plus creates, a minus destroys, a tilde updates in place and minus plus together means replace.

Typical traps

  • Thinking init is only needed once. It is needed again after adding a provider, module or changing the backend.
  • Believing plan refreshes nothing. It reads real objects to detect drift unless told otherwise.
  • Confusing fmt (style) with validate (correctness).
  • Forgetting that destroy is effectively a plan with all resources removed, and it shows you a plan first.

Sample questions

Question 1. A developer adds a new provider to required_providers and runs terraform plan, but gets an error that the provider is not installed. What should they run first?

  • A. terraform validate
  • B. terraform fmt
  • C. terraform init
  • D. terraform apply
Show answer

Answer: C

Providers are downloaded by terraform init, which must be run again after adding a provider. Validate checks syntax, fmt restyles, and apply cannot work before the provider is installed.

Want more questions like this? Full Terraform 004 practice tests →

Question 2. A team wants to review exactly what will change and apply only that reviewed set later. Which approach fits?

  • A. Save the plan to a file and apply that file
  • B. Run terraform apply with no arguments and trust the result
  • C. Run terraform fmt and commit
  • D. Run terraform validate and apply later
Show answer

Answer: A

Saving the plan to a file with the out option and applying that file guarantees that what was reviewed is what runs. Running apply directly recalculates the plan, fmt does not produce a plan and validate does not preview changes.

Want more questions like this? Full Terraform 004 practice tests →

Question 3. Which statement best describes why Terraform can manage resources on several different platforms with one workflow?

  • A. The state file contains a copy of each cloud’s API
  • B. The registry runs the infrastructure on its own servers
  • C. The CLI has built-in code for every cloud platform
  • D. Providers are plugins that translate configuration into each platform’s API calls
Show answer

Answer: D

Providers are plugins that talk to each platform’s API, so the same configuration language and commands work across services. State does not talk to APIs, the registry only distributes plugins and modules, and the CLI has no built-in knowledge of each cloud.

Want more questions like this? Full Terraform 004 practice tests →

Next

Continue with configuration, the objective with the most sub-objectives, or check the study plan for where this fits in week 1.