Stage 1 — Theory¶
Definitions and mechanics, ordered so that each page only needs the ones before it. No cloud account, no credentials, no cost — this is the stage you can read on a train.
Nineteen pages, each one topic. Read them in order the first time; after that, come in through the concept index or the glossary.
The sequence¶
| # | Page | The question it answers |
|---|---|---|
| 1 | What Terraform is | What does declarative actually mean, and what gets compared to what? |
| 2 | Providers and authentication | Who makes the API calls, and as whom? |
| 3 | terraform init and version constraints |
What does init do, and why commit the lock file? |
| 4 | Resources and state | What does Terraform own, and how does it remember? |
| 5 | Resource identity and change behaviour | Why did renaming it destroy it, and why is that field force-new? |
| 6 | Dependencies and the graph | What decides the order things are created in? |
| 7 | Variables and locals | Where do values come from, and which source wins? |
| 8 | Expressions and conditionals | How do you express "only if", with no if statement? |
| 9 | count, for_each and dynamic |
How do you make many of something without churning all of it? |
| 10 | Outputs | How does a value get out of a config? |
| 11 | Data sources | How do you read something you don't own? |
| 12 | Modules | How do you package infrastructure for reuse, and when shouldn't you? |
| 13 | State lifecycle | What happens when state and reality disagree? |
| 14 | Backends and state security | Where should state live, and who can read the secrets in it? |
| 15 | Cross-config composition | How do two repos share a value, and what breaks? |
| 16 | GitOps and CI/CD | Why shouldn't developers run apply at all? |
| 17 | Project structure | Which file, which directory, which root? |
| 18 | CLI reference | Which command was it again? |
| 19 | Glossary | What does that word mean? |
How this connects to the rest¶
| Stage | Relationship to this one |
|---|---|
| Stage 2 — Basics | the same mechanics, run locally against local/random/null — every page here links to its lab |
| Stage 3 — GCP | the same mechanics against a real project, in 18 labs |
| Stage 4 — Sandbox | all of it at once, plus the failure modes that only appear at scale |
| Quiz | 33 questions, all drawn from things that actually broke |
Pages 1–12 are the mechanics you need to write Terraform. Pages 13–17 are the ones you need to run it somewhere that matters — they're the second half for a reason, but they're also where the expensive mistakes live.
Reading it as reference¶
- Pages 1–18 open with an Assumes line naming its one prerequisite. The glossary has no prerequisite — it's a lookup table.
- Every page closes with a
Next:link, and most also link to the labs that run the concept for real and the quiz that tests it. A missingQuiz:link means exactly what it looks like: no question has been written for that concept yet. The concept index tracks those gaps in one place. - Section numbers (
§4,§13) used elsewhere in these docs refer to the numbers in the table above.
Start with What Terraform is.