Terraform Learning Path
Learn Terraform in order: HCL, resources, state, modules and environments, then build real cloud infrastructure. Free guides, simulators and exercises.
What you will be able to do
- Explain what Terraform does and run the init, plan and apply loop
- Write HCL with variables, loops, outputs and data sources
- Keep state safe with a remote backend and locking, and move resources without recreating them
- Split code into modules and separate environments
- Build a VPC and a server on a real cloud
10 guide chapters, 6 articles, 2 simulators, 2 interview questions, 2 exercises, 1 checklist, 1 challenge, 1 quiz. Every step is free. Tick a step when you finish it, or let the guide, exercise and checklist pages tick it for you.
// stage 014 steps · 1 h 1 min
Infrastructure as code
What Terraform does, and the workflow you repeat for every change.
Guide chapter14 min
What Is Terraform? Core Concepts and Workflow
What Terraform is, how providers work and the core workflow.
Guide chapter22 min
How to Install Terraform and Run Your First Apply
Install Terraform and run your first apply.
Simulator20 min
Terraform Basics Simulator
Run init, plan and apply in a browser terminal and watch state change.
Interview question5 min
Infrastructure as Code Patterns
Explain the common IaC patterns and when each one fits.
// stage 025 steps · 1 h 19 min
The language
Read and write HCL with confidence, from a single resource to loops.
Guide chapter15 min
Terraform Configuration Language (HCL) Basics
Blocks, arguments, expressions and types.
Guide chapter21 min
Terraform Resources, Data Sources and Meta-Arguments
Resources, data sources and meta-arguments such as count and for_each.
Guide chapter15 min
Terraform Variables and Outputs
Inputs and outputs that make one configuration reusable.
Article16 min
Terraform Variables, Loops, and Outputs: The Complete Guide
Loops and conditionals with worked examples you can copy.
Article12 min
How to Reference for_each Resources in Terraform: Keys, Indexes and Import
Reference for_each resources by key, and import ones that already exist.
// stage 035 steps · 1 h 14 min
State
The file Terraform trusts more than your cloud, and how to keep it safe.
Guide chapter21 min
Terraform State Management: Commands, Drift and Locking
What state is, how drift happens and the state commands.
Article14 min
Terraform State: Remove, Move and Migrate Resources, and Set Up a Remote Backend
Move and remove resources in state without destroying them.
Guide chapter19 min
Terraform Remote Backends: S3 Native Locking and Team Workflows
Remote backends with locking, so a team can share one state.
Interview question5 min
Terraform State Management
Answer the state questions almost every Terraform interview asks.
// stage 045 steps · 1 h 24 min
Modules and environments
Organize code so dev, staging and production share it without stepping on each other.
Article14 min
Terraform Module Outputs, Inputs and Sources: How Modules Pass Data to Each Other
How modules pass data to each other through inputs and outputs.
Guide chapter14 min
Managing Multiple Environments with Terraform
Keep dev, staging and production apart.
Article13 min
How to Organize a Terraform Repository: Environments, Modules, Files
A repository layout that still works when the code grows.
// stage 056 steps · 4 h 57 min
Real infrastructure
Build on a real cloud, fix broken code and keep it in sync with reality.
Exercise1 h
Deploy a DigitalOcean Droplet with Terraform
Create a server with Terraform from an empty directory.
Guide chapter23 min
Terraform Best Practices for Production
The habits that keep Terraform safe in production.
Article19 min
Terraform Drift Detection, Measured: What a Scheduled Plan and a Cloud Inventory Each Miss
Catch drift between code and cloud before it surprises you.