30-sec Infra Fix · IF2
terraform plan taking forever? Try -minimal-refresh
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.
Steps
1. Check your version
You need Terraform 1.17.0 or later.
terraform version2. Plan with minimal refresh
terraform plan -minimal-refresh3. 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.
# nightly drift check: full refresh
terraform plan -detailed-exitcode4. 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:
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 planin 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.mmdTerraform 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 planandterraform plan -minimal-refreshon 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
IF1 · Chaos testing without being Netflix: Resilience Hub's 4 ready-made tests
AWS Resilience Hub (next gen) now ships recommended resilience tests powered by AWS FIS: AZ recovery, dependency validation, Multi-Region isolation and recovery.
IF3 · Your alarms catch outages, not slowness: test gray failures with AWS FIS
AWS FIS scenario library: "AZ: Application Slowdown" and "Cross-AZ: Traffic Slowdown" simulate gray failures so you can check alarms catch slowness and practise AZ evacuation.