Score the complexity of a Terraform plan from resource changes and dependencies.
Not all plan changes carry equal risk. Formula: complexity = creates×1 + updates×2 + destroys×3 + replacements×4 — the weights reflect that in-place updates carry more risk than pure additions, destroys carry more risk than updates (data loss potential), and forced replacements (destroy-then-recreate) carry the most risk since they combine both destructive and additive risk with possible downtime.
complexity = creates × 1 + updates × 2 + destroys × 3 + replacements × 4
A replacement means Terraform must destroy the existing resource and create a new one to apply a change — this can cause downtime, lose non-exported state (like an IP address or generated ID), and is often triggered by a change the author didn't anticipate would force it.
Run `terraform plan` and look for the `-/+` prefix (destroy and re-create) on resources — Terraform explicitly annotates which changes force replacement versus a safe in-place update.
Request an additional reviewer, run the plan against a non-production workspace first if possible, and double-check any resources marked for replacement for data loss risk (e.g. databases, stateful storage).
Not well — ten straightforward creates are far lower risk than two forced replacements of a production database, which is why this calculator weights by change type rather than just counting resources.