Terraform
The de facto IaC tool. Multi-cloud. HCL config language. Plan, apply, state — the discipline of declarative infrastructure.
Mindmap
The plain-English version
Terraform is HashiCorp's infrastructure-as-code tool. You declare desired state in HCL (HashiCorp Configuration Language) — "this S3 bucket, this VPC, this RDS instance" — and terraform apply makes it true. Multi-cloud through providers; the same workflow whether you're on AWS, GCP, Azure, or Cloudflare.
The problem it solves
Console-clicking infrastructure is unauditable, unrepeatable, and forgetful. Terraform turns infrastructure into reviewable code in git. Plan output is gold — read it before apply, every time. The state file is the source of truth Terraform uses to know what's deployed.
Alternatives
| Alternative | Type | When it wins |
|---|---|---|
| Ansible | config mgmt | The agentless configuration management tool. YAML playbooks over SSH. The default in this category today. |
Deep links
The words you'll hear
- Plan / Apply
- Show what would change / actually change it.
- State
- Terraform's record of what's deployed. Stored remotely (S3, Terraform Cloud) for team use.
- Provider
- A plugin that knows how to talk to a service (AWS, GCP, Cloudflare, GitHub, etc.).
- Module
- Reusable bundle of HCL code. Like a function for infrastructure.
- Drift
- Real infrastructure diverging from the code. Detect and reconcile.
- Workspace
- Separate state for the same code (dev/staging/prod).
- Backend
- Where state is stored. S3+DynamoDB lock pattern is common.
Bad vs. good prompt for Terraform
Why it works: Names every property explicitly. The default S3 bucket Terraform makes is none of these things; the realistic configuration is what's described. Short enough to ship in one sitting.
What bites real teams
One console click and reality differs from the code. Discipline: every change goes through Terraform.
If you lose the state file, Terraform forgets what it built. Use remote state with locking from day one.
Some teams run apply automatically on PR merge. Without manual approval, a bad PR can wreck production. Always pause for human review on plan output.