Steven's Knowledge

Terraform

Declarative infrastructure provisioning with HashiCorp Configuration Language - from first apply to production-ready patterns

Terraform

Terraform is an open-source infrastructure-as-code tool from HashiCorp. You describe cloud and on-premise resources in declarative HCL (HashiCorp Configuration Language) files, and Terraform figures out the API calls needed to make reality match your description.

Why Terraform

Without IaCWith Terraform
Clicks in a console, undocumented changesEvery resource lives in version control
"Works on Dave's laptop" infrastructureReproducible across staging, prod, disaster recovery
Manual drift reconciliationterraform plan shows drift before you apply
Cloud-specific tooling per providerOne workflow across 3,000+ providers (AWS, GCP, Azure, K8s, Datadog...)

The Core Loop

write HCL  →  terraform plan  →  review diff  →  terraform apply

                                                 state file

The state file is Terraform's memory: it maps your HCL resources to real cloud objects, so the next plan can compute a diff instead of recreating everything.

Learning Path

Read in this order if you're new — each page builds on the previous one.

Terraform vs. Alternatives

ToolLanguageApproachWhen to choose
TerraformHCLDeclarativeMulti-cloud, mature ecosystem, large community
OpenTofuHCLDeclarativeDrop-in fork under MPL 2.0 (truly open-source)
PulumiTS/Python/GoImperativeYou want real programming language abstractions
CloudFormationYAML/JSONDeclarativeAWS-only, want native AWS integration
CrossplaneKubernetes CRDsDeclarativeYou already live inside Kubernetes
AnsibleYAMLProceduralConfiguration management (what runs on the box)

Terraform and Ansible solve different problems. Use Terraform to provision infrastructure (VMs, networks, DBs), and Ansible to configure what runs on it (packages, users, app deploys). See Ansible for the other half.

On this page