Anmol HandaChaos with Anmol

30-sec Infra Fix · IF2

terraform plan taking forever? Try -minimal-refresh

Terraform 1.17.0: Oct 21, 2026 · By Anmol Handa · The reel is 30 seconds. This is the long version.

Tumhara terraform plan itna time leta hai ki chai thandi ho jaati hai? Terraform 1.17 added one flag for the everyday case.

What's new

Terraform 1.17.0 was released on October 21, 2026. Its release notes add a new planning option, -minimal-refresh, which only refreshes resources that have proposed changes.

By default, terraform plan refreshes every resource in your state, reading its real status from the provider before comparing it with your configuration. On a big state that's a lot of API calls, even when you changed one tag on one bucket.

Why it matters

  • Faster feedback on small, everyday changes in large states.
  • Fewer provider API calls, which helps when you're near rate limits.
  • It sits between the two options you had before: a full refresh of everything, or -refresh=false, which skips refresh entirely.
Seedhi baatRoz ke chhote changes pe wait kam. Par drift ka check band mat karna.

Steps

1. Check your version

You need Terraform 1.17.0 or later.

terraform version

2. Plan with minimal refresh

terraform plan -minimal-refresh

3. Keep a full plan on a schedule

Run a normal plan nightly or in CI so drift elsewhere still gets caught. -detailed-exitcode returns exit code 2 when there are changes, which makes it easy to alert on.

CI / nightly
# nightly drift check: full refresh
terraform plan -detailed-exitcode

4. Pin the version for your team

If teammates or CI runners use an older Terraform, the flag won't exist for them. Set a minimum in your configuration:

versions.tf
terraform {
  required_version = ">= 1.17.0"
}

Caveats

  • Drift on untouched resources won't show. If someone changed a resource by hand in the console and your change doesn't touch it, a minimal-refresh plan won't tell you. That's the whole trade.
  • So treat it as a developer-loop speedup, not a replacement for full plans. Keep a full terraform plan in CI or nightly.
  • It's new in 1.17. Test it on a non-critical workspace before you make it your default.

Bonus: two more from 1.16 and 1.17

terraform graph in Mermaid (1.16)

Terraform 1.16.0 (August 26, 2026) lets terraform graph output Mermaid, which renders in many Markdown viewers. Handy for docs and PR descriptions.

terraform graph -format=mermaid > graph.mmd

Terraform Policy is GA (1.17)

In 1.17.0, Terraform Policy is generally available. The -policies flag for plan, apply and query no longer needs an experimental build or the -allow-experimental-features flag. Check the release notes for how to point it at your policies.

Try it safely

  • Run terraform plan and terraform plan -minimal-refresh on the same small change in a dev workspace and compare the output.
  • Time both runs yourself. Don't trust anyone's numbers, including mine; your state size decides.
  • Make a harmless change by hand in a dev resource you are not editing. See that only the full plan reports it. Now you've seen the caveat with your own eyes.
  • Add the nightly full-plan job before you roll the flag out to the team.

Official sources

More 30-sec Infra Fixes