Skip to main content

tf-arch-diagram-generator (Python)

Turn any Terraform plan into an interactive cloud architecture diagram — for AWS, Google Cloud and Azure, including plans that span all three.

This is the Python distribution of the tf-arch-diagram-generator npm package: the same tf-arch command, installable with pip, plus a small tf_arch API. Supports Python 3.12, 3.13, and 3.14. The rendering engine is JavaScript, bundled inside the wheel and run on your local Node.js 22 or newer — there are no third-party Python dependencies and nothing is downloaded at install or run time.

pip install tf-arch-diagram-generator      # or: pipx install / uv tool install

terraform plan -out=tfplan && terraform show -json tfplan > plan.json
tf-arch serve plan.json --open              # interactive viewer
tf-arch render plan.json -o arch.svg        # standalone SVG, no browser
tf-arch inspect plan.json --json            # machine-readable summary

Python 3.12+ and Node.js 22+ are the prerequisites: install Node.js from nodejs.org or with your package manager, nvm or fnm. If node is not on PATH, point TF_ARCH_NODE at the binary. pip install itself does not check for Node — the first tf-arch command does, and exits with status 127 and an install pointer if it is missing.

Python API

import tf_arch

svg = tf_arch.render("plan.json", title="Production")   # SVG as a string
tf_arch.render("plan.json", out="docs/architecture.svg")  # …or written to disk

summary = tf_arch.inspect("plan.json")
summary["stats"]       # {'create': …, 'update': …, 'delete': …, 'noop': …, 'total': …}
summary["providers"]   # [{'id': 'aws', 'shortName': 'AWS', …}, …]
summary["resources"]   # address, type, provider, action, service, network, subnet, zone, region
summary["edges"]       # inferred relationships

tf_arch.serve("plan.json", port=5173, open_browser=True)  # blocks; returns 130 on Ctrl+C

render and inspect also accept the plan as an already-parsed dict. Failures raise tf_arch.CommandError (with the CLI's message and exit status) or tf_arch.NodeNotFoundError. tf_arch.run([...]) passes arbitrary arguments straight through to the CLI.

What you get

  • Three clouds, one tool — AWS, Google Cloud and Azure, 280+ resource types mapped to the official vendor architecture icons. Multi-provider plans render as one band per cloud.
  • Real containment hierarchy — VPC / VPC Network / Virtual Network → zones → public and private subnets.
  • Deep reference & architectural links — Extracts real dependency links from Terraform expressions and attribute values (KMS keys, IAM roles, security groups, target groups, route tables, peering).
  • Perimeter-snapped connectors & relationship styling — Connectors snap directly to outer card perimeters with clearance offsets so arrowheads never bury under cards. Distinguishes traffic flows, security/encryption (dashed amber), peering (purple), and dependencies.
  • Directional spotlighting & connected links inspector — Dual-directional highlighting (inbound in blue, outbound in violet), toggleable connection labels, and an interactive Connected Links drawer with one-click navigation.
  • Plan-aware badges (+ create, ~ update, - destroy) with attribute-level diffs in the inspector.
  • Headless rendering for CI, and a hardened local viewer (loopback only, Host validation, strict CSP).
  • Private by design — plans are processed on your machine; no telemetry, no network calls.

Full documentation, the library API for JavaScript, provider coverage and security notes live in the project README. Terraform plans routinely contain sensitive values — read SECURITY.md before sharing a plan or an exported diagram.

License

MIT. The embedded cloud icons remain the property of AWS, Google and Microsoft under their own terms.

Metadata

Release files for tf-arch-diagram-generator 1.4.3

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

Source distribution (sdist)

Source distribution for tf-arch-diagram-generator 1.4.3
File Size Uploaded Provenance Actions
tf_arch_diagram_generator-1.4.3.tar.gz 811.1 kB With provenance Details for tf_arch_diagram_generator-1.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tf-arch-diagram-generator 1.4.3
File Interpreter ABI Platform Actions
tf_arch_diagram_generator-1.4.3-py3-none-any.whl Python 3 none any Details for tf_arch_diagram_generator-1.4.3-py3-none-any.whl

Total release size: 1.6 MB

Release files / tf_arch_diagram_generator-1.4.3.tar.gz

Download URL tf_arch_diagram_generator-1.4.3.tar.gz
Size 811.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eeb26c8739578d14d1188d32b25e7939fe3bbddd2b9a70d6b729b8a227c3e0a5
BLAKE2b-256 checksum
How to use checksums
341ef3555555cfa2a4a1100b5d3e9e44bdb530282f6dc6603b09005c4876af8f
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 Nov 2, 2026.

Transparency log

Release files / tf_arch_diagram_generator-1.4.3-py3-none-any.whl

Download URL tf_arch_diagram_generator-1.4.3-py3-none-any.whl
Size 825.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40154c4bed14f8b4356179463b4bf23f24c2166dae4948ae967c68f381467d4c
BLAKE2b-256 checksum
How to use checksums
2057053dabf00cc7572fd281aac99a591cae224e57300b4e85734e9dc8ebf529
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 Nov 2, 2026.

Transparency log

Security for tf-arch-diagram-generator 1.4.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tf_arch_diagram_generator-1.4.3.tar.gz

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 Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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