All Tools View Categories About Contact Privacy

Terraform Module Dependency Visualizer

Visualize module dependencies from your Terraform (.tf) as a Mermaid graph by parsing module calls and references.

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

About Terraform Module Dependency Visualizer

Large Terraform projects quickly grow into a web of modules that call one another, and understanding those relationships by reading raw .tf is slow and error prone. The Terraform Module Dependency Visualizer parses the configuration you paste, extracts every module block and the references between modules, and draws a Mermaid graph TD that makes the structure obvious at a glance.

The tool reads each module block and its source, then scans every attribute for references such as module.vpc.id and draws an edge from the referenced module to the one that uses it. The result is a standard Mermaid definition you can render in any Mermaid-aware viewer, Markdown file, or wiki. Everything runs locally in your browser: only the text you paste is read, nothing is uploaded, and no Terraform or registry call is made. That makes it a safe, private way to review architecture, onboard teammates, or spot a surprise circular dependency before it reaches a plan. Because the parse is purely structural, the visualizer works on partial configurations too, so you can diagram a work-in-progress module without a complete, valid tree.

Features

  • Module nodes - every module block becomes a labelled node showing its source and name.
  • Reference edges - edges are drawn from every module.X usage to the module that provides the referenced attribute, so direction always matches real data flow.
  • Mermaid output - copy-pasteable graph TD text that renders anywhere Mermaid is supported, including GitHub, GitLab, and many wikis.
  • Counts - live stats show how many modules and edges were found.
  • Isolated detection - modules with no references are still shown so nothing hides from view.
  • Private parsing - the pasted .tf is parsed in your browser and never leaves the page.
  • Error panel - unparseable HCL is reported with a clear message instead of a blank screen.
  • Word wrap toggle - switch long Mermaid lines between scroll and wrap for comfortable reading.
  • Copy, download, print - export the graph in the format your docs expect, whether that is an inline snippet or a full downloadable file.
  • Sample loader - one click pastes a realistic two-module example so you can see the output shape instantly.
  • Deterministic ids - node identifiers are derived from module names, so the same input always yields the same graph.

How to Use

  1. Paste your .tf that contains one or more module blocks and their attributes.
  2. Click Visualize to parse the configuration and build the dependency graph.
  3. Read the graph in the preview and note the module and edge counts.
  4. Toggle word wrap if the Mermaid lines are too wide to scan comfortably.
  5. Copy the Mermaid into a README, pull request, or wiki that renders diagrams.
  6. Download or print the graph so you can attach it to design documents.
  7. Iterate by editing the .tf, pasting again, and re-visualizing to confirm the changes.
  8. Review for cycles - scan the rendered graph for arrows that loop back, which would indicate a circular module dependency worth fixing now.

Examples

Example 1 - direct dependency. Paste a file with module "vpc" and module "app" where app sets vpc_id = module.vpc.id and subnet_id = module.vpc.public_subnet_id. The visualizer produces a graph with two nodes, vpc and app, and a directed edge from vpc to app, showing that app depends on vpc. External registry sources appear as labelled nodes but are not expanded, keeping the diagram focused on your own modules rather than third-party code.

Example 2 - no dependencies. Paste a single module block with no module.X references. The graph shows that module as an isolated node and prints a note that no inter-module dependencies were detected, which is useful for confirming a leaf module really is self-contained before you publish it.

Benefits

  • Fast insight - see the whole module graph in seconds instead of reading every file by hand and mentally tracing references.
  • No secrets sent - the configuration is parsed locally and never uploaded anywhere, so sensitive sources stay private.
  • Portable - standard Mermaid text drops into almost any documentation tool you already use, from wikis to pull requests.
  • Onboarding - new teammates grasp module structure from a single picture instead of a long architecture meeting.
  • Safer changes - spot unexpected edges and potential circular dependencies early in the process, before they break a plan.
  • Reviewable - a committed graph becomes a living artefact that catches drift when the architecture changes later.

Frequently Asked Questions

How are module dependencies found?
The tool reads each module block and its source, then scans attributes for references to other modules (e.g. module.vpc.id) and draws an edge between them.
What format is the output?
A Mermaid graph TD definition you can render anywhere Mermaid is supported.
Does it connect to anything?
No. It only parses the .tf you paste locally.
Why are some modules isolated?
If a module does not reference another module, no edge is drawn for it. External registry sources are shown but not expanded.
Can I export the graph?
Yes. Copy the Mermaid text, download it, or print it.