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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tf_arch_diagram_generator-1.2.0.tar.gz (225.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tf_arch_diagram_generator-1.2.0-py3-none-any.whl (237.9 kB view details)

Uploaded Python 3

File details

Details for the file tf_arch_diagram_generator-1.2.0.tar.gz.

File metadata

File hashes

Hashes for tf_arch_diagram_generator-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d5e5628c682a19d15c6833320cf47405601e124a0b454d4d334e5a293e55b706
MD5 728e26681f3b70f5c54c11f0d00634d8
BLAKE2b-256 47b50f52117bbed57a04eb319361446a6d25e86cbc715f5f93b2187751a2e610

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tf_arch_diagram_generator-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tf_arch_diagram_generator-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17f36d4aea87fe409196818f01baeec011c92b09575988a1f24d6368d0165603
MD5 e98f89b2f0379a10f058f9da33a0c7b4
BLAKE2b-256 71583bb3b9a95289e1161dbb158114a76938a74636fe0ce455921a2625f19d44

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page