Terraform · zero to on-call
Read the plan before it reads you.
State, plans, modules and drift, learned by fixing real incidents on a simulated cloud that never sends a bill.
Learning Terraform?
Start from zero, step by step.
Levels in order, each with a hands-on incident to fix in your browser.
Something broken right now?
Paste the error, get the fix.
The cause, the commands to confirm it and the fix, for every common Terraform error.
Everything you need, from the first init to the 3 a.m. incident.
Fix a broken Terraform project. Right here.
Real incidents, real terraform commands and real error messages. No install, no account, no cloud bill.
What happens when you run terraform apply
Select a step to see what it does, or play the whole run.
Practise on your own machine
Run the AWS examples
Each folder in the repository is a working example. Real AWS resources cost money: destroy them when you finish.
# 1. Get the examples
git clone https://github.com/SandeepKomal/Terraform-HashiCorp.git
cd Terraform-HashiCorp/tf-vpc
# 2. Check who you are in AWS
aws sts get-caller-identity
# 3. The workflow
terraform init
terraform fmt -check
terraform validate
terraform plan -out=tfplan
terraform apply tfplan
# 4. Clean up
terraform destroy
Terraform or OpenTofu?
Either works for everything here.
OpenTofu is an open-source fork of Terraform, started in 2023 after HashiCorp moved Terraform to the Business Source License, and maintained under the Linux Foundation.
Its tofu command takes the same commands and HCL for nearly everything on this site: tofu init, tofu plan, tofu apply. Messages say OpenTofu instead of Terraform, and the newest features of each have started to differ, so check its documentation for those.
Your path
Progress is saved in this browser only. Tick a level when you have solved its scenarios.
Quiz
Scenario questions for every level, from the first init to production. You see right or wrong as soon as you answer, with the reasoning.
HCL X-ray
Paste a .tf file to see what every block and argument does, which settings are risky, and what is missing. Or open one of this repository's own.
Stuck on an error?
Paste the error Terraform printed, or search by word. Each answer explains what it means, then each likely cause with a check that proves it and the fix for that cause, and how to prevent it, then gives you a safe scenario to break and fix it yourself, so you recognise it next time.
A plain version of this reference, readable without JavaScript: problems.html.
Cheat sheet
The commands people use every day. Try runs a command in the playground, opening the scenario it needs. Lab marks the ones that need a real installation or account.
Fill in your own names
What happens on terraform apply
What runs where when you type terraform apply: the CLI and core, providers, the registry and lock file, state, the backend and its lock, and the cloud. Point at a component, or tab to it, to read about it.