Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
  • Python 96.3%
  • HTML 3.4%
  • Nix 0.2%
Find a file
Patrick Chugh 21a808526e
Revise Ubuntu/Debian installation commands
Updated installation commands for Ubuntu/Debian to use the latest syntax and added installation of libgvplugin-neato-layout8.
2026-05-06 15:28:23 +01:00
.devcontainer Adding Dockerfile, update Dependencies for Python 3.14 (#138) 2026-01-15 22:16:43 +00:00
.github Docs overhaul: MkDocs Material site, FAQ, restructured README 2026-04-17 14:18:31 +01:00
docs Revise Ubuntu/Debian installation commands 2026-05-06 15:28:23 +01:00
hcl2 fixed variable handling 2022-10-23 22:41:40 +01:00
images Add YouTube play-button overlay to the intro thumbnail 2026-04-17 14:26:14 +01:00
modules Version bump 0.39.0 2026-04-30 19:32:31 +01:00
resource_classes 0.39.0: AI backend rework (boto3 Bedrock + restapi) and WSL --show fix 2026-04-26 21:25:08 +01:00
resource_images Completed core services on GCP 2026-01-10 19:14:58 +00:00
scripts Fix cluster label visibility, AWS Cloud title, IAM shapes, HTML label parsing 2026-04-16 21:36:34 +01:00
terravision 0.39.0: AI backend rework (boto3 Bedrock + restapi) and WSL --show fix 2026-04-26 21:25:08 +01:00
tests Prompt fixes and OLLAMA model selector added 2026-04-30 19:26:57 +01:00
.dockerignore Version bump 0.32.0 - exclude specs from docker image build 2026-04-06 15:58:02 +01:00
.gitignore Docs overhaul: MkDocs Material site, FAQ, restructured README 2026-04-17 14:18:31 +01:00
.pre-commit-config.yaml precommit hook 2026-03-14 12:39:59 +00:00
clearcache.sh Adding Dockerfile, update Dependencies for Python 3.14 (#138) 2026-01-15 22:16:43 +00:00
docker-entrypoint.sh feat(tfenv): include tfenv to specifiy TF version 2026-03-24 10:51:14 +11:00
Dockerfile Auto-fetch latest Terraform version in Docker build 2026-03-29 08:32:08 +01:00
flake.lock Add Nix flake as Option 3 (#160) 2026-01-22 22:47:21 +00:00
flake.nix Add Nix flake as Option 3 (#160) 2026-01-22 22:47:21 +00:00
LICENSE Code Overhaul 2025-10-20 14:39:00 +01:00
mkdocs.yml dark theme 2026-04-17 14:27:42 +01:00
poetry.lock 0.39.0: AI backend rework (boto3 Bedrock + restapi) and WSL --show fix 2026-04-26 21:25:08 +01:00
pyproject.toml Version bump 0.39.0 2026-04-30 19:32:31 +01:00
pytest.ini custom pytest marker 2025-11-22 09:47:56 +00:00
README.md 0.39.0: AI backend rework (boto3 Bedrock + restapi) and WSL --show fix 2026-04-26 21:25:08 +01:00
RELEASE_NOTES.md Prompt fixes and OLLAMA model selector added 2026-04-30 19:26:57 +01:00
requirements.txt Native draw.io emitter replacing graphviz2drawio (issue #188) 2026-04-16 19:59:28 +01:00
shiftLabel.gvpr Compact footer and place flow legend alongside it 2026-04-14 15:57:58 +01:00

TerraVision

Turn Terraform code into professional cloud architecture diagrams that stay in sync with your infrastructure — automatic, secure, living documents

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 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.

Why TerraVision?

  • 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

Supported Cloud Providers

Provider Status Resources
AWS Full support 200+ services
Google Cloud 🔄 Partial support Core services
Azure 🔄 Partial support Core services

Quick Start

Install

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

You also need Python 3.10+, Terraform 1.x, Graphviz, and Git. See the Installation Guide for platform-specific instructions, Docker, and Nix.

Generate your first diagram

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.png and opens automatically.

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