Skip to content

Terraform: start here

Terraform is HashiCorp’s infrastructure as code tool: you declare cloud and platform resources in configuration files, review a plan of the changes, and apply it. This section teaches it in two pages, in the order you need it on a real project. Samples use an invented OrdersPortal application and were run with Terraform 1.17.2.

Step Page What you get from it
1 Terraform basics and the core workflow What Terraform is, the configuration blocks (providers, resources, variables, outputs), init and the lock file, plan and apply, per-environment variables and CI checks.
2 Terraform state and modules What state stores, remote state and locking, importing existing resources, refactoring with moved and removed blocks, workspaces, and reusable versioned modules.
If you need to Go to
Understand what Terraform does and when to use it What Terraform is
Review a change before applying it Plan and apply
Run the same code for dev, staging and production Variables and environments
Share state safely in a team Remote state and locking
Rename resources without destroying them Refactoring with moved and removed blocks
Stop copy-pasting the same infrastructure Modules