Ch 2 · IaC & GitOps
From the trenches
08 / 32

Local Terraform state is a production incident waiting to happen.

A GCS backend adds real locking the moment more than one person or process runs apply.

backend.tf
terraform {
  backend "gcs" {
    bucket = "meridian-terraform-state"
    prefix = "environments/staging"
  }
}
A two-person team ran local state for 8 months with no issue. The second engineer's first apply, from stale state, proposed to recreate 11 resources — including a production Cloud SQL instance — because neither state file knew about the other's changes.
The team's workflow had no mechanism forcing state to be shared and locked at all. A GCS backend from day one costs almost nothing and removes this entire failure class.