Skip to main content

TerraVision

Turn Terraform or JSON files into professional cloud architecture diagrams with the official AWS, Azure and GCP icons

lint-and-test PyPI version PyPI downloads Python version GitHub stars License Code style: black

📖 Full documentation site →


Watch a 4-Minute Intro

TerraVision intro video


What is TerraVision?

TerraVision automatically converts your Terraform code, or a plain JSON graph of Terraform resource names, into professional-grade cloud architecture diagrams using the official AWS, GCP, and Azure icon sets. Your diagrams stay in sync with your infrastructure — no more outdated Visio, draw.io or Lucidchart files.

Most diagram tools that AI assistants reach for (Mermaid, PlantUML, hand-drawn SVG) produce boxes and arrows. TerraVision produces the diagram a cloud architect would draw: real provider icons, VPCs and subnets nested correctly, resource groups, regions and zones. It runs entirely on your machine, needs no cloud credentials, and outputs PNG, SVG, PDF or an editable draw.io file.

Why TerraVision?

  • ✅ JSON graph input — describe an architecture in a few lines of JSON and render it, resources match Terraform names so no need to learn a custom DSL (Graph Format)
  • ✅ Always up-to-date — diagrams generated directly from your Terraform code
  • ✅ 100% client-side — no cloud access required, runs locally, your code never leaves your machine
  • ✅ CI/CD ready — automate diagram updates on every PR merge
  • ✅ Free & open source — no expensive diagramming tool licenses
  • ✅ Multi-cloud — AWS (full), GCP, and Azure (core services)
  • ✅ Interactive HTML output — clickable nodes, pan/zoom, search, animated data flow
  • ✅ Editable draw.io export — open in draw.io, Lucidchart, or any mxGraph editor
  • ✅ Optional AI annotations — labels, titles, and flow sequences from Ollama (local) or AWS Bedrock
  • ✅ Terragrunt compatible — auto-detects single- and multi-module Terragrunt projects
  • ✅ MCP server and agent skill — let AI agents generate diagrams from a JSON graph or your Terraform, see the guide

Supported Cloud Providers

Provider Status Resource types
AWS ✅ Full support 385 types
Google Cloud ✅ Full support 264 types
Azure ✅ Full support 245 types

Full list: Node types.


Quick Start

Install

pipx install terravision   # or: pip install terravision if in a virtual env

You also need Python 3.10+, Graphviz and Git, plus Terraform 1.x (or OpenTofu) when drawing from Terraform code; JSON graphs don't need it. See the Installation Guide for platform-specific instructions, Docker, and Nix.

Option 1 - Diagram from JSON (no Terraform needed)

Describe the architecture as nodes and connections. AWS is shown here; expand the Azure and GCP examples below.

{
  "tv_aws_users.users": ["aws_cloudfront_distribution.cdn"],
  "aws_cloudfront_distribution.cdn": ["aws_s3_bucket.static_site", "aws_alb.api"],
  "aws_vpc.main": ["aws_subnet.public~1", "aws_subnet.private~1"],
  "aws_subnet.public~1": ["aws_alb.api"],
  "aws_subnet.private~1": ["aws_lambda_function.orders"],
  "aws_alb.api": ["aws_lambda_function.orders"],
  "aws_lambda_function.orders": ["aws_dynamodb_table.orders", "aws_sqs_queue.events"]
}
Azure example
{
  "tv_azurerm_users.users": ["azurerm_cdn_frontdoor_profile.edge"],
  "azurerm_cdn_frontdoor_profile.edge": ["azurerm_linux_web_app.api"],
  "azurerm_resource_group.app": ["azurerm_virtual_network.main", "azurerm_mssql_database.orders", "azurerm_servicebus_queue.events", "azurerm_key_vault.secrets"],
  "azurerm_virtual_network.main": ["azurerm_subnet.app"],
  "azurerm_subnet.app": ["azurerm_linux_web_app.api"],
  "azurerm_linux_web_app.api": ["azurerm_mssql_database.orders", "azurerm_servicebus_queue.events", "azurerm_key_vault.secrets"]
}
GCP example
{
  "tv_gcp_users_icon.users": ["google_compute_global_forwarding_rule.lb"],
  "google_compute_global_forwarding_rule.lb": ["google_cloud_run_v2_service.api"],
  "google_cloud_run_v2_service.api": ["google_sql_database_instance.orders", "google_pubsub_topic.events", "google_storage_bucket.assets"],
  "google_pubsub_topic.events": ["google_cloudfunctions2_function.worker"]
}

Render it:

terravision draw --source architecture.tvg.json --format svg

Each key is <terraform_resource_type>.<name>; each value is what it connects to or contains. That is the whole format. Full spec, schema and more examples: Graph Format. Works for AWS (aws_*), Azure (azurerm_*) and GCP (google_*).

Using an AI assistant? Install the TerraVision skill (Claude Code, Codex, Gemini CLI, Cursor, Copilot) or the MCP server; the render_graph tool takes this JSON directly. For agents reading docs, llms.txt is a plain-text index of the docs, and llms-full.txt adds the full node-type reference.

Option 2 - Generate your diagram from Terraform

git clone https://github.com/patrickchugh/terravision.git
cd terravision

# EKS cluster example
terravision draw --source tests/fixtures/aws_terraform/eks_automode --show

# Azure VM scale set
terravision draw --source tests/fixtures/azure_terraform/test_vm_vmss --show

# From a public Git repo (note the // for subfolder)
terravision draw --source https://github.com/patrickchugh/terraform-examples.git//aws/wordpress_fargate --show

That's it — your diagram is saved as architecture-aws.dot.png (the provider is appended to the name) and opens automatically.

The diagram is derived from terraform plan, so it shows what the code actually deploys: conditionals, count, for_each and modules are resolved. Eraser and friends draw what the AI imagines; TerraVision proves what the code deploys.

Generate an interactive HTML diagram

terravision visualise --source ./path-to-your-terraform --show

Click any resource to see its Terraform metadata, search resources, pan/zoom, and watch animated data flow on edges. The HTML is a single self-contained file that works fully offline.


Try the Interactive Demos

Click any of these to see the interactive HTML output TerraVision produces:

  • 🟧 AWS demo — Wordpress on ECS Fargate with CloudFront, RDS, EFS
  • 🟦 Azure demo — VM scale set with load balancer and VNet
  • 🟩 GCP demo — Core GCP networking and compute

Basic Usage

Generate a diagram

# From a local directory
terravision draw --source ./path-to-your-terraform

# From a Git repository
terravision draw --source https://github.com/user/repo.git

# Custom format and filename
terravision draw --source ./path-to-your-terraform --format svg --outfile my-architecture

# Editable draw.io file
terravision draw --source ./path-to-your-terraform --format drawio --outfile my-architecture

Use a pre-generated Terraform plan (no cloud credentials needed)

# Step 1: in your Terraform environment
terraform plan -out=tfplan.bin
terraform show -json tfplan.bin > plan.json
terraform graph > graph.dot

# Step 2: diagram generation, no Terraform or cloud access required
terravision draw --planfile plan.json --graphfile graph.dot --source ./path-to-your-terraform

AI-powered annotations (optional)

terravision draw --source ./path-to-your-terraform --ai-annotate ollama   # local LLM (no data leaves your machine)
terravision draw --source ./path-to-your-terraform --ai-annotate bedrock  # AWS Bedrock via boto3 (uses your AWS credentials)
terravision draw --source ./path-to-your-terraform --ai-annotate restapi  # any OpenAI-compatible endpoint (OpenAI, LiteLLM, vLLM, ...)

Only metadata and the summary graph are sent to the LLM — never your .tf source. The bedrock backend authenticates via the standard AWS credential chain (no infrastructure to deploy); restapi is configured via TV_RESTAPI_URL, TV_RESTAPI_KEY, and TV_RESTAPI_MODEL. See the Annotations Guide and AI-Powered Annotations for the full configuration.

Simplified view

terravision draw --source ./path-to-your-terraform --simplified

Strips VPCs, subnets, and networking plumbing. Great for executive presentations.

Common options

terravision --help shows full help text details.

Option Description Example
--source Terraform directory or Git URL ./path-to-your-terraform
--format Output format: png, svg, pdf, drawio, and more svg
--outfile Output filename my-architecture
--workspace Terraform workspace production
--varfile Variable file (repeatable) prod.tfvars
--planfile Pre-generated plan JSON plan.json
--graphfile Pre-generated graph DOT graph.dot
--ai-annotate AI annotation backend ollama, bedrock, restapi
--simplified High-level view (no networking) (flag)
--show Open after generation (flag)

Documentation

The complete documentation lives at patrickchugh.github.io/terravision.

For users:

For contributors:


FAQ

Common questions — cloud credentials, LLM data privacy, offline use, Terragrunt, output formats, and more — are answered in the FAQ on the documentation site.


Contributing

Contributions are very welcome. See CONTRIBUTING.md for development setup, coding standards, and the PR process.

Support

License

See LICENSE.

Acknowledgments

  • Graphviz — diagram rendering
  • Terraform — infrastructure parsing
  • Terragrunt — multi-module orchestration
  • Cloud provider icons from official AWS, GCP, and Azure icon sets

Release files for terravision 0.48.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terravision 0.48.0
File Size Uploaded
terravision-0.48.0.tar.gz 21.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for terravision 0.48.0
File Interpreter ABI Platform
terravision-0.48.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 MB

Release files / terravision-0.48.0.tar.gz

Download URL terravision-0.48.0.tar.gz
Size 21.3 MB
Tags Source
SHA-256 checksum
How to use checksums
21f2bd2b799d1e6480c196fb6f9ea4e0e58498506dddaafd864b4a572a46e09e
BLAKE2b-256 checksum
How to use checksums
f20420c5eee4749b9852375f4f9897fc81fd7bb178f0cdd5200e0b9ca14e519c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / terravision-0.48.0-py3-none-any.whl

Download URL terravision-0.48.0-py3-none-any.whl
Size 22.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
07567edbd6684dfaeb30f410f8c6f3280ea9b41e5462ab5feba16cfea209ac5a
BLAKE2b-256 checksum
How to use checksums
763dfd80be8d99a157881e03fa82214d8058f1ef80306ea35570255014a7af12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.48.1

2 release files

This release

0.48.0 This release

2 release files

0.46.4

2 release files

0.46.3

2 release files

0.46.2

2 release files

0.46.1

2 release files

0.46.0

2 release files

0.43.2

2 release files

0.43.1

2 release files

0.43.0

2 release files

0.41.0

2 release files

0.40.3

2 release files

0.40.2

2 release files

0.40.1

2 release files

0.40.0

2 release files

0.39.0

2 release files

0.38.1

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.33.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.11.2

2 release files

0.11.0

2 release files

0.10.5

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page