Study HashiCorp Terraform 003 Init, Plan, Apply: key concepts, common traps, and exam decision cues.
This lesson matters because Terraform questions often become easy once you know which stage owns the behavior. init prepares the working directory, plan previews the change, apply executes it, and destroy tears it down.
| Requirement | Strongest first command |
|---|---|
| prepare working directory and install dependencies | terraform init |
| preview change | terraform plan |
| execute approved change | terraform apply |
| remove managed infrastructure | terraform destroy |
init.plan.apply.destroy.| Trap | Better rule |
|---|---|
using apply as if it were the preview step |
plan owns preview |
treating init like formatting or validation |
init prepares the working directory and backend/provider setup |
| forgetting destroy is a lifecycle stage too | lifecycle includes removal, not only creation |