Following references across a directory of Terraform files gets tedious when all I want is to understand how the resources connect. I built Terraviz to draw those relationships in the browser.
Drop in your .tf files and it produces an interactive infrastructure diagram. The files are parsed locally; there’s no backend or sign-up.
What Terraviz does
You give it your .tf files (drag and drop a folder, or browse for individual files), and it produces an interactive diagram.
Resources are rendered as color-coded nodes organized by category - compute, network, storage, database, security, DNS, CDN, monitoring, and more. Dependencies are auto-detected by parsing HCL reference expressions, so if your EC2 instance references a security group, that connection shows up as an edge in the graph.
Click any node and its direct dependencies light up while everything else dims. Click an edge to highlight the connection and both endpoints. Expand a node to inspect the raw HCL body. Drag, pan, and zoom to explore large infrastructures.
Showing the network structure
VPCs and subnets are rendered as visual containers, and resources are automatically placed inside their parent network based on attribute references - vpc_id, subnet_id, vpc_security_group_ids, and so on.
It also follows transitive relationships. If a resource doesn’t directly reference a VPC but references something that’s already inside one, Terraviz figures that out and places it in the right container.
Filter, search, and export
Not every diagram needs to show everything. Terraviz lets you toggle resource categories on and off to focus on specific layers - just networking, just compute, just security. The diagram re-layouts automatically when you hide or show categories.
There’s a search bar (Cmd+F / Ctrl+F) that lets you find any resource and zoom straight to it. Useful when you’re looking at a large project and need to locate something specific.
When you need to share what you’re looking at, you can export the diagram as a high-resolution PNG or SVG for documentation or architecture reviews.
Both light and dark themes have distinct colours for each resource category, and the app remembers your preference.
Multi-cloud support
The parser works with any Terraform provider, but category detection and containment grouping have enhanced support for AWS, GCP, and Azure. This means VPCs, virtual networks, subnetworks, and their child resources are all grouped correctly regardless of which cloud you’re working with.
Resources from other providers still show up - they’re categorized using general pattern matching and displayed without containment grouping.
Keeping files in the browser
Terraform files can reveal internal architecture through resource names, variable defaults, and provider configurations. That’s why Terraviz parses them client-side, without uploading or storing them.
You can try it at terraviz.dev. There’s a feedback button in the app if you run into a problem or have a suggestion.