Score the complexity of a Terraform dependency graph from nodes and edges.
Terraform builds a dependency graph of every resource, module and data source, then walks it to determine safe apply order. Formula: graph_complexity = nodes + edges. The parallelizable share (independent_resources / total) estimates how much of an apply can run concurrently — a graph with many independent leaf resources parallelizes well, while one with long dependency chains forces mostly-serial applies regardless of the `-parallelism` setting.
Graph complexity
graph_complexity = nodes + edges
Parallelizable share
parallelizable_percent = (independent_resources / total_nodes) × 100
Run `terraform graph` to get DOT output, then render it with Graphviz (`dot -Tsvg`) — for large configurations, filter to a subset with `-type=plan` or focus on specific modules to keep it readable.
Parallelism only helps for resources that don't depend on each other. If most of your graph is a long serial chain (e.g. VPC → subnet → security group → instance), no amount of `-parallelism` bypasses that ordering constraint.
Implicit dependencies created by referencing entire objects/modules (`module.vpc`) instead of specific attributes (`module.vpc.subnet_id`) can create edges that aren't strictly required, serializing resources that could otherwise apply in parallel.
Not directly — it's a proxy for reasoning complexity and coordination overhead. Actual apply time depends more on the parallelizable share and per-resource provisioning time (see the apply time calculator).