Interview Prep/Terraform/Workflow and Providers

A plan on a 2,000-resource state takes 25 minutes. What do you look at?

AdvancedScenarioWorkflow and Providers
Answer

Situation read → Time goes to refreshing every resource via cloud APIs, often throttled.

What I'd do →

  1. Confirm with TF_LOG=DEBUG or timing which provider calls dominate.
  2. Short term: terraform plan -refresh=false for quick local iteration, and raise -parallelism carefully (default 10).
  3. Medium term: split the state by lifecycle and ownership (network, data, apps).
  4. Check for API throttling and tune provider max_retries.

Why → Plan time is roughly linear in state size, so the structural fix is smaller states, not flags.

Interview tip → -target is not a performance tool; it hides drift and leaves partial applies.

All Terraform questions Roadmap: Terraform

More on Workflow and Providers