A package to help vizualise output from terraform graph as an svg file
Project description
A package to help vizualise output from terraform graph as an svg file
Free software: MIT license
Documentation: https://terragraph.readthedocs.io.
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
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.
Project details
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
File details
Details for the file terragraph-0.4.0.tar.gz
.
File metadata
- Download URL: terragraph-0.4.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c1e51c34ffb8f9b371fbfa1810e3d61941cf018990dfa7cc91b05171842ab28 |
|
MD5 | cd55374443478ed3953772e642cb853e |
|
BLAKE2b-256 | 0044150c888fd22108c13766dc58132df43c0c9973774b243caf796caa50079c |
File details
Details for the file terragraph-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: terragraph-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc210c4251309f16ad1b6a0650a7bbcb23ad9d2520d4790f8b140b74eb2a7d3d |
|
MD5 | 8d0fed3fe88f3379537de7616c41c4a8 |
|
BLAKE2b-256 | e4a9977bc53f737cc0e1208d166660c924ac82bf10bb4a4910ecabe53ae2b9b6 |