Learning paths · Skills · Intermediate

Terraform: infrastructure as code that you can trust

How Terraform turns declarative configuration into real infrastructure: the plan and apply cycle, the state file it all depends on, how to change and refactor resources without destroying them, how to split environments and modules, how to test and police changes, and where OpenTofu fits.

0 of 14 done

The map

  • Not started
  • In progress
  • Done
  1. 01The modelDeclare, plan, apply0/4
  2. 02StateWhat Terraform remembers0/3
  3. 03Changing things safelyLifecycle, drift, refactoring0/3
  4. 04At scaleModules, environments, tests, the fork0/4
  5. 05Next: system designSame ideas, at service scale

Written for Terraform 1.x (the current release is 1.16) and OpenTofu 1.x (currently 1.13). Features are marked with the version that introduced them where it matters: import and check blocks (1.5), terraform test (1.6), removed blocks and test mocks (1.7), ephemeral resources (1.10), write-only arguments (1.11) and S3 native state locking. Every example that was run uses only the random and local providers and the built-in terraform_data resource, so no cloud account is involved; the few AWS-flavoured snippets (backends, cloud resources) are illustrative and were not applied. The plan and test output shown comes from real runs: most with Terraform 1.5.7 (the last MPL-licensed release), and the terraform test, module, removed and replace_triggered_by examples with Terraform 1.16.6, both on macOS arm64 with hashicorp/random 3.9.1 and hashicorp/local 2.9.1.

Where this path leads