Terraform Graph Complexity Calculator
Score dependency graph complexity from node and edge counts, and calculate what share of resources can apply in parallel.
Inputs
Total resources/modules/data sources represented as graph nodes.
Total dependency relationships between nodes.
Resources with no dependency on another resource in the same apply.
Graph Complexity
440
Parallelizable Resources
33.3%
Complexity Level
Complex
Avg Edges per Node
1.44
Step by step
Graph complexity: nodes + edges
180 + 260
= 440
Parallelizable %: independent / total nodes
60 / 180
= 33.3%
How it works
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.
Formulas
Graph complexity
graph_complexity = nodes + edges
- nodes
- Resources/modules/data sources as graph nodes
- edges
- Dependency relationships between nodes
Parallelizable share
parallelizable_percent = (independent_resources / total_nodes) × 100
- independent_resources
- Resources with no dependency on another in the same apply
- total_nodes
- Total graph nodes
Frequently Asked Questions
How do I see my actual dependency graph?
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.
Why doesn't increasing parallelism always speed up applies?
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.
What increases graph complexity unnecessarily?
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.
Does higher graph complexity always mean slower applies?
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).
You might also need
- Terraform Module Dependency CalculatorCommonly used together
- Terraform Plan Complexity CalculatorCommonly used together
- Terraform Apply Time CalculatorCommonly used together
- Terraform Resource Count CalculatorAlso in Terraform
- Terraform Variable Size CalculatorAlso in Terraform
- Terraform Drift CalculatorAlso in Terraform