Arendus / Praktikamärkus
Terraform esimesest päevast
Taristu kui kood tasub end kõige kiiremini ära alguses, kui importida on vähe ja iga ressurss saab sündida hallatuna.
See praktikamärkus on avaldatud inglise keeles.
Teams usually adopt Terraform after the console sprawl hurts — which means weeks of importing resources that already exist, each one a small archaeology project. Starting with Terraform on day one skips all of that. Every resource is born managed, reviewed and reproducible.
State belongs in a backend
Local state files are how two engineers overwrite each other's infrastructure. Remote state with locking — Azure Blob Storage or Google Cloud Storage — from the very first apply. This is a ten-minute setup that prevents the worst failure mode.
Modules later, flat first
Premature modules abstract over unknowns. Start with a flat configuration per environment, and extract modules only when the third copy of a pattern appears. Duplication across two environments is cheaper than the wrong abstraction.
Plan in the pipeline
Every pull request runs plan; only merges to main run apply — with approvals on production. The plan output is the review: readable proof of what will change before anything changes. Pair it with cost estimation so surprises arrive as comments, not invoices.
Further reading: Terraform documentation.