All Tools View Categories About Contact Privacy

Terraform Resource Dependency Graph Generator

Generate a Mermaid dependency graph from your Terraform (.tf) by parsing references and depends_on.

Runs entirely in your browser - nothing is uploaded and no cloud connection is made.
0
nodes
0
edges
Your Mermaid graph will appear here.

About Terraform Resource Dependency Graph Generator

The Terraform Resource Dependency Graph Generator turns your pasted .tf configuration into a clear Mermaid dependency graph, helping you see how resources connect at a glance. In any non trivial Terraform project, resources reference one another through arguments such as vpc_id = aws_vpc.main.id, or explicitly through depends_on. Understanding those relationships is essential for reasoning about create, update, and destroy order, and for spotting circular or missing dependencies. This tool parses your configuration entirely in the browser, detects both explicit depends_on entries and implicit references between resource addresses, and draws a directed edge from the referenced resource to the one that depends on it. The result is a standard Mermaid graph you can paste into any Mermaid renderer, a GitHub Markdown file, or a wiki. Nothing is uploaded and no external service is contacted, so your infrastructure code stays private. Reach for this generator during code review, onboarding, or incident debugging when you need a fast visual map of resource relationships instead of reading through hundreds of lines of HCL. The graph also makes it easy to communicate architecture to teammates who may not read Terraform fluently, because a picture of the dependency flow is far quicker to absorb than raw configuration files. You can regenerate the diagram whenever the .tf changes, keeping the visualization in sync with the source. For large modules the graph highlights which resources sit at the root of the dependency chain and which are leaves, which helps when planning refactors or estimating the blast radius of a change.

Features

  • Explicit depends_on - draws an edge from each listed dependency to the resource.
  • Implicit references - detects resource addresses used inside attributes and nested blocks.
  • Mermaid output - produces a copy pasteable graph definition for any renderer.
  • Direction toggle - switch between a top down (TD) and left right (LR) layout.
  • Node and edge counts - shows quick stats after generation.
  • Multiple resources - scales across an entire pasted configuration.
  • No edge note - comments in the graph when no dependency is detected.
  • Private - parses locally so nothing is uploaded and the parser never contacts a registry.
  • Copy, download, print - export the graph wherever you need it.
  • Clipboard safe - plain Mermaid text is copied without markup.
  • Deterministic ids - stable node identifiers for repeatable, diffable graphs.
  • Subresource scanning - nested blocks are scanned for references as well as top level attributes.
  • Stable rendering - node order follows source order so the output is predictable and easy to review.
  • No server - pure client side parsing with no network calls.
  • Account free - no sign up or token is required to generate a graph.

How to Use

  1. Paste your Terraform .tf containing two or more resources into the text area.
  2. Optionally choose a graph direction from the layout selector above the button.
  3. Click Generate to build the Mermaid dependency graph.
  4. Read the stats row for the node and edge counts.
  5. Copy the Mermaid text into a renderer or a Markdown file.
  6. Download the .mmd or print it for a design review or document.
  7. Adjust references in your .tf and regenerate if the graph needs updating.
  8. Use the rendered graph in your documentation to keep architecture diagrams current with the code.

Examples

Example 1 - pasting an aws_subnet that references aws_vpc.main.id and an aws_instance that references aws_subnet.public.id produces a graph with edges vpc to subnet to instance. Example 2 - an explicit depends_on on a null_resource adds a direct edge from the named resource. Example 3 - a configuration with no cross references still renders every node but notes that no dependencies were detected. Example 4 - switching the layout to left right reorients the same edges horizontally for wide diagrams. Example 5 - a module block that references a resource adds an edge from that resource into the module node, so cross module dependencies are visible too.

Benefits

  • Fast insight - visualize dependencies instantly instead of scanning HCL.
  • No secrets sent - everything stays local on your machine.
  • Portable - standard Mermaid works in many tools and docs.
  • Review friendly - share graphs directly inside pull requests.
  • Learning aid - understand create and destroy ordering quickly.
  • Private - fully client side with no external connections.
  • Current - regenerate at any time to match the source of truth.

Frequently Asked Questions

How are dependencies found?
The tool scans each resource for explicit depends_on entries and for references to other resource addresses (e.g. aws_vpc.main) inside its attributes and blocks, then draws an edge from the referenced resource to the referencing one.
What format is the output?
A Mermaid graph TD definition that you can paste into any Mermaid renderer or GitHub Markdown.
Does it connect to anything?
No. It parses the .tf you paste locally and emits text only.
Why is my edge missing?
Only direct textual references and depends_on are detected. Indirect references via modules or locals may not be captured.
Can I export the graph?
Yes. Copy the Mermaid text, download it, or print it.