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

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.1
File Size Uploaded
tf_arch_diagram_generator-1.4.1.tar.gz 807.5 kB Details

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / tf_arch_diagram_generator-1.4.1.tar.gz

Download URL tf_arch_diagram_generator-1.4.1.tar.gz
Size 807.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9cc403449e491af0121c8f0db214c3c90fb5030e58b7eaf7fabbd177f0d0a85b
BLAKE2b-256 checksum
How to use checksums
6951f97aa43ef64e8efa94d14e66e312cc8edaf27c52fb420a4a55909fe28420
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 Oct 15, 2026.

Transparency log

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

Download URL tf_arch_diagram_generator-1.4.1-py3-none-any.whl
Size 825.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6350c0f0bd6a6e4f9e7cb8e878b88b82627f25f701c0f772c864fe5074bfbe6
BLAKE2b-256 checksum
How to use checksums
4631e7431ee5ac05646180697bc7bd180e10b87fa895dce63d96931eb877bc1e
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 Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.2

2 release files

This release

1.4.1 This release

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

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