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. The rendering engine is JavaScript, bundled inside the wheel and run on your local Node.js 22 or newer — there are no 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
Node.js is the only prerequisite: install it 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, 265 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.
- Inferred traffic flows and 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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tf_arch_diagram_generator-1.2.0.tar.gz.
File metadata
- Download URL: tf_arch_diagram_generator-1.2.0.tar.gz
- Upload date:
- Size: 225.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5e5628c682a19d15c6833320cf47405601e124a0b454d4d334e5a293e55b706
|
|
| MD5 |
728e26681f3b70f5c54c11f0d00634d8
|
|
| BLAKE2b-256 |
47b50f52117bbed57a04eb319361446a6d25e86cbc715f5f93b2187751a2e610
|
Provenance
The following attestation bundles were made for tf_arch_diagram_generator-1.2.0.tar.gz:
Publisher:
publish.yml on mchittineni/tf-arch-diagram-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tf_arch_diagram_generator-1.2.0.tar.gz -
Subject digest:
d5e5628c682a19d15c6833320cf47405601e124a0b454d4d334e5a293e55b706 - Sigstore transparency entry: 2583079624
- Sigstore integration time:
-
Permalink:
mchittineni/tf-arch-diagram-generator@a888e20c55a5629f9b4b0b231b7690c0fa6835bc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mchittineni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a888e20c55a5629f9b4b0b231b7690c0fa6835bc -
Trigger Event:
push
-
Statement type:
File details
Details for the file tf_arch_diagram_generator-1.2.0-py3-none-any.whl.
File metadata
- Download URL: tf_arch_diagram_generator-1.2.0-py3-none-any.whl
- Upload date:
- Size: 237.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f36d4aea87fe409196818f01baeec011c92b09575988a1f24d6368d0165603
|
|
| MD5 |
e98f89b2f0379a10f058f9da33a0c7b4
|
|
| BLAKE2b-256 |
71583bb3b9a95289e1161dbb158114a76938a74636fe0ce455921a2625f19d44
|
Provenance
The following attestation bundles were made for tf_arch_diagram_generator-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on mchittineni/tf-arch-diagram-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tf_arch_diagram_generator-1.2.0-py3-none-any.whl -
Subject digest:
17f36d4aea87fe409196818f01baeec011c92b09575988a1f24d6368d0165603 - Sigstore transparency entry: 2583079633
- Sigstore integration time:
-
Permalink:
mchittineni/tf-arch-diagram-generator@a888e20c55a5629f9b4b0b231b7690c0fa6835bc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mchittineni
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a888e20c55a5629f9b4b0b231b7690c0fa6835bc -
Trigger Event:
push
-
Statement type: