Menu

Our Terraform drift check runs in 40 seconds
📰

Our Terraform drift check runs in 40 seconds

DEV Community: terraform·Sawyer Jenkins·about 3 hours ago
#0ug4ZqYz
#devtoterraform#devto#dev#plan#drift
Reading 0:00
15s threshold

Sawyer Jenkins

For a long time, drift detection meant a nightly terraform plan that took 20 minutes and got ignored.

We split the state into small stacks, cached the providers, and now the plan finishes in about 40 seconds. Suddenly people actually read it.

A few details that mattered:

  • -refresh=false for the quick check, full refresh only on demand
  • Pin provider versions (the surprise upgrades were painful)
  • Fail CI only on unexpected drift, not on known pending changes

Boring infrastructure is a feature. I'll take a 40-second plan over a heroic migration any day.