/terravision-cloud-diagrams:terravision-cloud-diagramsfrom terravision-cloud-diagrams
Draws cloud architecture diagrams for AWS, Azure, or GCP using official provider icons with TerraVision. Groups resources into VPCs, subnets, regions, and zones. Works with or without Terraform code.
Ships in terravision-cloud-diagrams. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TerraVision renders cloud architecture diagrams using the official AWS, Azure and GCP icon sets, with resources grouped into VPCs, subnets, resource groups, regions and zones the way a cloud architect would draw them. Output is PNG, SVG, PDF, DOT, or an editable draw.io file.
Use it for pictures of AWS, Azure or GCP infrastructure: which services exist, where they sit in the network, and how they connect.
Do not use it for anything else. Sequence diagrams, flowcharts, class or ER diagrams, code or module structure, org charts and on-premises-only networks are better drawn with Mermaid or similar. A request flow through the infrastructure belongs on the TerraVision diagram itself, as numbered steps ("Flows" below).
If you can call diagram_guide and render_graph (the TerraVision MCP server), use them instead of the command line, and skip Install, the validator, and the files under references/ and examples/:
diagram_guide(provider) returns, in one call, the graph rules, a detailed worked example, the supported node types, the gallery of designs, a library of patterns and whether Graphviz is installed. diagram_guide(provider, example=<name>) returns one gallery design with its title, CIDR ranges, labels and flows as render_graph arguments.render_graph(graph, outfile="three_tier", title=...) checks the graph, returns warnings and a preview image, and saves the PNG, SVG, draw.io file and graph. Pass outfile as a name; files always go to the server's output folder.Everything else here still applies: the rules, "Drawn as written", "Check every render" and "Deliver the result".
| Situation | Path |
|---|---|
| The user has Terraform code (a directory, a Git URL) | Path A: derive the diagram from the code |
| The user describes an architecture in words, or you designed one | Path B: write a JSON graph and render it |
Path B needs only Graphviz and Git. Path A also needs Terraform (or OpenTofu) on PATH.
Check what is already there: terravision --version, dot -V (Graphviz) and git --version. All three are needed, even for a JSON graph. Install only what is missing, and ask the user before installing anything system-wide.
TerraVision needs Python 3.11 or newer. Use the first installer that exists on the machine:
| Available | Command |
|---|---|
uv | uv tool install terravision. uv fetches a suitable Python itself. To run without installing, prefix commands with uvx: uvx terravision draw ... |
pipx | pipx install terravision |
only pip | python3 -m pip install --user terravision (Windows: py -m pip install --user terravision). If pip refuses with externally-managed-environment, install into a virtual environment instead: python3 -m venv ~/.venvs/terravision && ~/.venvs/terravision/bin/pip install terravision, then run ~/.venvs/terravision/bin/terravision (Windows: py -m venv %USERPROFILE%\.venvs\terravision, then use %USERPROFILE%\.venvs\terravision\Scripts\terravision) |
| none of these | Install uv (https://docs.astral.sh/uv/getting-started/installation/), then use the first row |
If terravision is installed but not found, its folder is not on PATH: run uv tool update-shell or pipx ensurepath and open a new terminal, or call it by its full path.
Graphviz and Git:
| OS | Command |
|---|---|
| macOS | brew install graphviz git |
| Debian / Ubuntu | sudo apt install graphviz git. On Ubuntu 26.04+ and Debian testing, also sudo apt install libgvplugin-neato-layout8: the neato layout engine TerraVision uses is a separate package there |
| Fedora / RHEL | sudo dnf install graphviz git |
| Windows | scoop install graphviz git, choco install graphviz git, or winget install --id Graphviz.Graphviz and winget install --id Git.Git |
After a winget install, dot -V in a terminal still reports not found, because that installer does not add Graphviz to PATH. That is expected: TerraVision 0.48.2 and later find C:\Program Files\Graphviz\bin by themselves. To confirm Graphviz is installed, check that dot.exe exists there instead of running dot -V.
Terraform, for Path A only. A JSON graph never runs Terraform. For Terraform code, check terraform version (must be 1.x); OpenTofu works too (tofu version, then add --engine tofu). To install Terraform:
| OS | Command |
|---|---|
| macOS | brew tap hashicorp/tap && brew install hashicorp/tap/terraform (OpenTofu: brew install opentofu) |
| Debian / Ubuntu | add HashiCorp's apt repository, then sudo apt install terraform; steps at https://developer.hashicorp.com/terraform/install |
| Windows | winget install --id Hashicorp.Terraform, or choco install terraform, or scoop install terraform |
OpenTofu for other systems: https://opentofu.org/docs/intro/install/
TerraVision runs terraform init and terraform plan on the user's code, so the plan needs whatever the user normally plans with: network access for providers and modules, and often cloud credentials. If that is not possible here, ask the user to run these where their Terraform works, then use Path A with --planfile plan.json --graphfile graph.dot:
terraform init && terraform plan -out=tfplan.bin
terraform show -json tfplan.bin > plan.json
terraform graph > graph.dot
terravision draw --source ./path/to/terraform --format svg --outfile architecture
Useful flags: --title "Payments - Production", --varfile prod.tfvars, --workspace staging, --simplified (services only, no networking boxes), --format drawio (editable), --planfile plan.json --graphfile graph.dot (use an existing plan, no cloud credentials needed).
For an interactive page to explore in a browser (click any resource to see its settings, search, zoom): terravision visualise --source ./tf --show.
If the user only wants the structure as data: terravision graphdata --source ./tf --outfile architecture.tvg.json.
Git repositories work as the source too, public or private (with the user's Git access): --source https://github.com/org/repo, or https://github.com/org/repo//examples for a folder inside it. Many repositories hold a reusable module at their root, which plans no resources on its own. If the root fails with "found no resources" or asks for required variables, look in the repository for a folder that uses the module (examples/, environments/prod, anything with a provider block) and draw that with //folder.
Write a JSON object where each key is a node address <terraform_resource_type>.<name> and each value is the list of node addresses it connects to or contains. Read references/graph-format.md for the full rules and references/node-types.md when unsure which type to use.
Save it as <name>.tvg.json in the user's current working directory, or a folder they name. The diagram files are the deliverable, so never put them in a temporary folder.
Render a PNG to look at and a draw.io file to edit:
terravision draw --source <name>.tvg.json --format png --outfile <name> --title "Order Platform"
terravision draw --source <name>.tvg.json --format drawio --outfile <name> --title "Order Platform"
They are written as <name>.dot.png and <name>.drawio. Add --format svg as well if the user wants to embed it in documentation.
Check the PNG ("Check every render" below), then deliver it ("Deliver the result" at the end).
Minimal example:
{
"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"],
"aws_group.shared_services": ["aws_cloudwatch_log_group.orders"]
}
Rules that matter most:
aws_*, azurerm_* (with azuread_* for Entra ID), google_*. Mixing them is an error; draw one diagram per provider.aws_alb or aws_nlb, not aws_lb. aws_ecs_fargate for Fargate, not aws_ecs_service. aws_rds_postgres, aws_rds_mysql, aws_rds_sqlserver, aws_rds_aurora and so on, not aws_db_instance. aws_eks_service for an EKS cluster.aws_vpc, aws_subnet, tv_aws_az, azurerm_resource_group, azurerm_virtual_network, azurerm_subnet, google_compute_network, google_compute_subnetwork, tv_gcp_region, tv_gcp_zone. These are containers too, though they read like services: aws_autoscaling_group, aws_security_group, google_container_cluster, google_container_node_pool, google_compute_instance_group, google_compute_firewall. Anything they list is drawn inside them. The full list is in references/graph-format.md.tv_aws_users.<name>, tv_aws_internet.<name>, tv_aws_mobile_client.<name>, tv_aws_onprem.<name>, tv_azurerm_users.<name>, tv_azurerm_internet.<name>, tv_gcp_users_icon.<name> (plain tv_gcp_users draws a group box, not an icon). For systems outside AWS: tv_aws_server.<name>, tv_aws_client.<name> (a workstation) and tv_aws_database.<name>.tv_aws_onprem box, outside the AWS Cloud, holding its servers, workstations and databases and its router as aws_customer_gateway. Direct Connect runs aws_customer_gateway → aws_dx_connection → aws_dx_gateway → aws_ec2_transit_gateway (or a virtual private gateway); a site-to-site VPN runs aws_customer_gateway → aws_vpn_connection → the Transit Gateway. examples/aws-multi-account-network.tvg.json shows both, with central inspection and egress.aws_subnet.private~1, aws_subnet.private~2. Always point at the copies, never the unnumbered name, or an extra node can appear.orders_table, not Orders-Table).TerraVision draws the graph exactly as written; it does not add, move or group nodes for you. These drawing rules explain most surprises:
aws_group.shared_services or azurerm_group.shared_services so they appear together in a Shared Services box instead of floating. Arrows from an Azure identity (azurerm_user_assigned_identity, azuread_service_principal, azuread_group, azuread_user) are the exception: they are permissions, drawn dashed even into a shared service, so draw a role assignment as an arrow from the identity to what it may use with the role as its edge label ("Key Vault Secrets User"), not as an azurerm_role_assignment node. Entra ID objects (azuread_*) go in a tv_azure_entra.tenant box, outside the resource groups.aws_alb.web~1, aws_alb.web~2). Inside nested boxes, list it only in the innermost (its subnet), not also in the network or resource group around it.references/node-types.md.Worked examples in examples/: three-tier web apps for each cloud (three-tier-web.tvg.json for AWS, azure-three-tier.tvg.json, gcp-three-tier.tvg.json), plus aws-event-driven.tvg.json, azure-web-app.tvg.json and gcp-serverless-api.tvg.json, and the hybrid multi-account network aws-multi-account-network.tvg.json. Copy the closest one, keep its level of detail (zones, public and private subnets, the path to the internet, shared services) and edit. For other service mixes, examples/patterns/ holds 26 more (EKS, ECS, API Gateway, Step Functions, SageMaker, Glue, GKE, AKS and others), listed with descriptions in examples/patterns/index.json. They are TerraVision's own output for real Terraform, so following them keeps its level of detail. examples/gallery/ holds every gallery design, 19 per cloud (streaming, MLOps, IoT, hybrid networks, multi-region, SaaS, payments, security and more), each as <name>.tvg.json with its <name>.annotations.yml (title, CIDR ranges, arrow labels, flows), listed with descriptions in examples/gallery/index.json; when one is close to the request, start from it and draw with --annotate.
Validate before rendering: python scripts/validate_graph.py architecture.tvg.json. It fails on bad addresses or mixed providers, and prints a WARNING for anything in the list above that will not draw the way it reads. Fix the warnings, or accept them if they are intended.
Call render_graph with the graph object directly (no file needed), or generate_diagram with a Terraform source. Both take an optional title, optional flows (numbered steps; see "Flows" below) and optional edge_labels (a few words on existing arrows, rule 11 in references/graph-format.md); render_graph also takes attributes, to give networks and subnets realistic CIDR ranges (rule 10). Each call saves a PNG, an SVG, an editable draw.io file and the graph as .tvg.json, and returns their paths under files plus a preview image of the diagram: look at it to check the diagram ("Check every render" below). In apps that support MCP Apps, such as Claude Desktop, VS Code and Cursor, the user also sees the diagram in an interactive view with buttons to open, edit and copy it. Elsewhere, call open_diagram_file with the PNG path to open it for the user, instead of running open or xdg-open yourself. If the result has warnings (an unknown type with suggested replacements, arrows that will not be drawn), fix the graph and render again.
Numbered badges with a legend can show how a request or data moves through the diagram. The format is rule 10 in references/graph-format.md: pass flows to the MCP tools, or on the command line put a flows: section in a YAML file and add --annotate <file>.
aws_alb.api~1), and fix any step the result warns draws no badge.TerraVision draws exactly what it is given. When a diagram looks wrong, assume the cause is in your input, not in TerraVision: usually a node missing from its container, a wrong type, a missing or extra connection, or one of the "Drawn as written" rules above.
references/graph-format.md); every node is listed under the container you meant.--simplified, or the editable --format drawio file to rearrange by hand.'dot' or 'git' not found: see Install.'terraform' not found while using a .json source, or No such option: --title: TerraVision is too old. Upgrade with the tool that installed it: uv tool upgrade terravision, pipx upgrade terravision or python3 -m pip install -U terravision.Graph mixes aws_* and azurerm_* resources: split the graph into one file per provider.references/node-types.md; pick the closest listed type.--simplified, or reduce numbered copies to one per tier.As soon as a render passes your check, do all of this in the same reply. Never wait for the user to ask to see the diagram or the JSON.
open <file> on macOS, xdg-open <file> on Linux, wslview <file> on WSL, start <file> on Windows (Invoke-Item <file> in PowerShell). Skip this only on a remote or headless machine, such as Linux with neither DISPLAY nor WAYLAND_DISPLAY set, and say so.json code block, so the user can read it and ask for changes.<name>.dot.png: the diagram<name>.drawio: open in draw.io (diagrams.net) to edit by hand<name>.tvg.json: the graph; edit it and render again<name>.annotations.yml (with flows): the title and flows, for --annotategenerate_interactive_html with the same source, or terravision visualise --source <folder> --show; it runs the plan again). Do none of them before the user says yes.If the user asks for Terraform:
terraform plan, which needs cloud credentials. Instead, tell the user that once they can plan it, terravision visualise --source <folder> --show opens it as an interactive page in their browser, where every resource can be clicked to see its settings.terravision.yml in the Terraform folder from the diagram and its .annotations.yml: keep the title, rename every node in flows, connect and update to the Terraform address that creates it (aws_ecs_fargate.api becomes aws_ecs_service.api; numbered copies such as aws_alb.web~1 become the one resource), and add the external actors (users, internet) under add:, since Terraform has none. Keep each logical group (aws_group, azurerm_group, tv_gcp_logical_group) by declaring it under add: and listing its members, by Terraform address, under connect: (aws_group.fulfilment: [aws_sfn_state_machine.fulfilment, aws_lambda_function.charge]); a group drawn from Terraform is otherwise lost, because Terraform has no groups. Put the CIDR ranges in the Terraform code itself, where the diagram reads them. TerraVision loads that file whenever it draws the Terraform, including in CI.aws_customer_gateway in a box named tv_aws_onprem.corporate_datacenter, with Direct Connect starting from it, so do not write a second data centre box. To keep the on-premises systems the diagram showed, declare that box and the systems under add: and list the systems in it under connect:, with their arrows to the router: add: {tv_aws_onprem.corporate_datacenter: {}, tv_aws_server.erp: {}}, connect: {tv_aws_onprem.corporate_datacenter: [tv_aws_server.erp], aws_customer_gateway.router: [tv_aws_server.erp]}. The box must be declared under add:: the annotations are applied before TerraVision creates it.patrickchugh/terravision-action for GitHub Actions, and setups for GitLab, Jenkins, Azure DevOps and others at https://patrickchugh.github.io/terravision/cicd-integration/.With the MCP server, report the paths from files the same way, and let the result's display line decide step 1. When it says the app is showing the diagram in its interactive view, the diagram is already in front of the user: do not open it in an image viewer as well, by open_diagram_file or a shell command, and still show the JSON. When it says the app has no diagram view, show or open the PNG as in step 1.
examples/aws-event-driven.tvg.json (opens in a new tab)examples/aws-multi-account-network.tvg.json (opens in a new tab)examples/azure-three-tier.tvg.json (opens in a new tab)examples/azure-web-app.tvg.json (opens in a new tab)examples/gallery/aws-batch-hpc.annotations.yml (opens in a new tab)examples/gallery/aws-batch-hpc.tvg.json (opens in a new tab)examples/gallery/aws-data-lake.annotations.yml (opens in a new tab)examples/gallery/aws-data-lake.tvg.json (opens in a new tab)examples/gallery/aws-ecs-fargate-api.annotations.yml (opens in a new tab)examples/gallery/aws-ecs-fargate-api.tvg.json (opens in a new tab)examples/gallery/aws-eks-karpenter.annotations.yml (opens in a new tab)examples/gallery/aws-eks-karpenter.tvg.json (opens in a new tab)examples/gallery/aws-event-driven.annotations.yml (opens in a new tab)examples/gallery/aws-event-driven.tvg.json (opens in a new tab)examples/gallery/aws-hybrid-direct-connect.annotations.yml (opens in a new tab)examples/gallery/aws-hybrid-direct-connect.tvg.json (opens in a new tab)examples/gallery/aws-iot-telemetry.annotations.yml (opens in a new tab)examples/gallery/aws-iot-telemetry.tvg.json (opens in a new tab)examples/gallery/aws-media-processing.annotations.yml (opens in a new tab)examples/gallery/aws-media-processing.tvg.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub patrickchugh/terravision --plugin terravision-cloud-diagramsOther plugins' skills for the same job