The Terraform Core Workflow

The four commands that power every Terraform project, init, plan, apply, and destroy. Learn the complete workflow loop used by every DevOps engineer managing infrastructure as code.

The Four Commands That Power Terraform

No matter how large or complex your infrastructure becomes, every Terraform workflow follows the same simple loop built around four commands:

CommandWhat it doesWhen to run it
terraform initDownloads providers, sets up the backendOnce per project, and after any provider/backend change
terraform planShows exactly what will change, no side effectsEvery time before applying
terraform applyCreates, updates or deletes infrastructureAfter reviewing and approving the plan
terraform destroyRemoves all managed resourcesWhen tearing down an environment

This loop, write → init → plan → apply: is the heartbeat of Infrastructure as Code. You will repeat it for the entire lifetime of every Terraform project.

The Workflow in Practice

# 1. Write your configuration in .tf files, then initialise
terraform init

# 2. Preview every change before it happens
terraform plan

# 3. Apply after reviewing the plan output
terraform apply

# 4. Tear down when done
terraform destroy

The critical thing that separates Terraform from clicking through a cloud console is the plan step. Before any infrastructure changes, you see a precise diff, every resource to be created (+), updated (~), replaced (-/+), or deleted (-). Nothing is a surprise.

What This Section Covers

Each command has its own dedicated page with complete detail, real examples, and common pitfalls:

  • terraform init: What init does internally, provider downloads, backend setup, and the lock file
  • terraform plan: Reading the execution plan, understanding resource symbols, saving plan files, and targeting
  • terraform apply: Applying changes safely, auto-approve in CI/CD, and what happens during apply
  • terraform destroy: Safely tearing down environments and partial destroys

Start with terraform init →

Continue Learning

Explore Related Topics

Try the Tool

Related Resources