Skip to main content

Terraform Architecture Visualizer

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terravision-0.40.3.tar.gz (21.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terravision-0.40.3-py3-none-any.whl (22.0 MB view details)

Uploaded Python 3

File details

Details for the file terravision-0.40.3.tar.gz.

File metadata

  • Download URL: terravision-0.40.3.tar.gz
  • Upload date:
  • Size: 21.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for terravision-0.40.3.tar.gz
Algorithm Hash digest
SHA256 5fef308797e5dc5c109bd857cfda768d3a2aa3ac6f391e0271052b2a7292cf40
MD5 89acbfb8473c67c3dab2bddbb2fb325f
BLAKE2b-256 c34191113d0aa095efd2ce201f54c665633a4987a452443be3c9ef8ac20d353c

See more details on using hashes here.

Provenance

The following attestation bundles were made for terravision-0.40.3.tar.gz:

Publisher: publish-to-pypi.yml on patrickchugh/terravision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terravision-0.40.3-py3-none-any.whl.

File metadata

  • Download URL: terravision-0.40.3-py3-none-any.whl
  • Upload date:
  • Size: 22.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for terravision-0.40.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d96016cced171d4608427be8d3dbbc4331f5478b7e2b92c79c00012280d7564a
MD5 f8f48a1061c7709468a76fe06849f918
BLAKE2b-256 449d0f63edc2025c180909dff96cd404902c91c11151686c9c958d77747402ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for terravision-0.40.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on patrickchugh/terravision

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page