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

Metadata

Release files for tf-arch-diagram-generator 1.2.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.2.1
File Size Uploaded
tf_arch_diagram_generator-1.2.1.tar.gz 225.3 kB Details

Built distribution (wheel)

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

Total release size: 463.1 kB

Release files / tf_arch_diagram_generator-1.2.1.tar.gz

Download URL tf_arch_diagram_generator-1.2.1.tar.gz
Size 225.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9bb069160f808cfe2c5fb7118edaa859b5f3ea550828cafc94051ddd3a83d130
BLAKE2b-256 checksum
How to use checksums
b458590902e1e6698288a47caee0df81e82b65429bebd973e2dcf00c04ed621c
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 Sep 1, 2026.

Transparency log

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

Download URL tf_arch_diagram_generator-1.2.1-py3-none-any.whl
Size 237.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e94d4078f6db12352d7257a3e28ab3f233a343530091f9661b19d45d879ab952
BLAKE2b-256 checksum
How to use checksums
6041c7f8e099bd5cbf7500151ca1b4708cfdda0e749da278f36d72384d88b9c5
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 Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

This release

1.2.1 This release

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