TerraVision

April 26, 2026 ยท View on GitHub

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

ProviderStatusResources
AWSโœ… Full support200+ services
Google Cloud๐Ÿ”„ Partial supportCore services
Azure๐Ÿ”„ Partial supportCore 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.

OptionDescriptionExample
--sourceTerraform directory or Git URL./path-to-your-terraform
--formatOutput format: png, svg, pdf, drawio, and moresvg
--outfileOutput filenamemy-architecture
--workspaceTerraform workspaceproduction
--varfileVariable file (repeatable)prod.tfvars
--planfilePre-generated plan JSONplan.json
--graphfilePre-generated graph DOTgraph.dot
--ai-annotateAI annotation backendollama, bedrock, restapi
--simplifiedHigh-level view (no networking)(flag)
--showOpen 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