Skip to main content

terragraph

https://img.shields.io/pypi/v/terragraph.svg https://img.shields.io/travis/cdsre/terragraph.svg Documentation Status

A package to help vizualise output from terraform graph as an svg file

Overview

The idea behind this is to choose a node on a terraform dependency graph and be able to highlight all the preceding or successor edges or both, recursively.

Terraform is pretty good at calculating dependencies however sometimes there are casues where terraform cannot know. or where users don’t realise how terraform generates dependencies. This can lead to race conditions where running the first time fails but running the second time works. A prime example of this is when we pass an output of module A as an input of module B. In most cases users assume that outputs of module A will not be available until all resources in the module have finished. However, this is not the case. Terraform will start running module B as soon as the output in module A is available even when other resources in module A are not finished but module B expects them to be.

Generating a terraform graph is easy. However, these graphs can get very large very quickly. So trying to follow and understand the dependencies of one resource in relation to other resources can get complicated. This project attempts to solve that by taking the output from a terraform graph command and selecting a specific node to highlight dependenices. it provides a HighlightingMode to allow the user to decide if they want to see all the resources the node depends on, all the resources that depend on this node, or both.

Usage

Currently, this is pretty raw, it just runs at the command line taking the DOT format file and the node name to highlight. By default it will highlight all PRECEDING edges. These are the things that must be completed before this node can start. It also supports passing the mode as a flag. The modes are

mode flags

Value

Description

PRECEDING

Highlights all preceding edges to this node. This is all things that needs to complete before this node start

SUCCESSOR

Highlights all successor edges from this node. This is all things that cannot start until this node is completed

ALL

This applies both PRECEDING and SUCCESSOR modes to highlight the full up and down dependency tree for the node

terragraph --file-name docs/assets/graph.dot --node-name '"[root] module.mod2.random_pet.this (expand)"'
Colored node SVG file generated: docs/assets/graph.dot.svg

The above will create an SVG file with the preceding edges highlighted.

graph_output

Metadata

Release files for terragraph 0.4.0

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

Source distribution (sdist)

Source distribution for terragraph 0.4.0
File Size Uploaded Provenance Actions
terragraph-0.4.0.tar.gz 17.1 kB Without provenance Details for terragraph-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for terragraph 0.4.0
File Interpreter ABI Platform Actions
terragraph-0.4.0-py3-none-any.whl Python 3 none any Details for terragraph-0.4.0-py3-none-any.whl

Total release size: 24.5 kB

Release files / terragraph-0.4.0.tar.gz

Download URL terragraph-0.4.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3c1e51c34ffb8f9b371fbfa1810e3d61941cf018990dfa7cc91b05171842ab28
BLAKE2b-256 checksum
How to use checksums
0044150c888fd22108c13766dc58132df43c0c9973774b243caf796caa50079c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / terragraph-0.4.0-py3-none-any.whl

Download URL terragraph-0.4.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc210c4251309f16ad1b6a0650a7bbcb23ad9d2520d4790f8b140b74eb2a7d3d
BLAKE2b-256 checksum
How to use checksums
e4a9977bc53f737cc0e1208d166660c924ac82bf10bb4a4910ecabe53ae2b9b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for terragraph 0.4.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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