Skip to main content

Interactive visualizations of Terraform dependency graphs

Project description

# Blast Radius

[![PyPI version](](

*Blast Radius* is a tool for reasoning about *Terraform* dependency graphs with interactive visualizations. Use *Blast Radius* to:
* **Learn** about *Terraform* or one of its cloud providers, through [example configurations](
* **Document** your infrastructure
* **Reason** about relationships between resources, and evaluate changes to them.

![Blast Radius Preview](doc/blast-radius-demo.svg)

* **Interact** with this diagram (and many others) [here](

# Quickstart

Install *Blast Radius* with pip, and *Graphviz* through your system's package manager.

[...]$ pip3 install BlastRadius
[...]$ brew install graphviz

Point *Blast Radius* at an `init-ed` *Terraform* project, and connect with your browser.

[...]$ blast-radius --serve /path/to/terraform-project
* Running on (Press CTRL+C to quit)

*Alternatively*, you can launch *Blast Radius* in a docker container. (In this example, the current working directory contains a *Terraform* project.)

[...]$ docker run -it --rm -p 5000:5000 -v $(pwd):/workdir 28mm/blast-radius

# Embeded Figures

You may wish to embed figures produced with *Blast Radius* in other documents. You will need the following:

1. an `svg` file and `json` document representing the graph and its layout. These are produced with *Blast Radius*, as follows

[...]$ terraform graph | blast-radius --svg > graph.svg
[...]$ terraform graph | blast-radius --json > graph.json

2. `javascript` and `css`. You can find these in the `.../blastradius/server/static` directory. Copy these files to an appropriate location, and ammend the following includes to reflect those locations.

<script src="/static/js/d3.v4.js"></script>
<script src="/static/js/d3-tip.js"></script>
<script src="/static/js/terraform-graph.js"></script>
<script src="/static/js/categories.js"></script>
<link rel="stylesheet" type="text/css" href="/static/css/style.css">

3. A uniquely identified DOM element, where the `<svg>` should appear, and a call to `svg_activate(...)` somewhere after (usually at the end of the `<html>` document.

<div id="graph"></div>
svg_activate('#graph', '/graph.svg', '/graph.json');

That's it. Ideas to simplify this process strongly desired.

# Implementation Details

*Blast Radius* uses the [*Graphviz*]( package to layout graph diagrams, [*PyHCL*]( to parse [*Terraform*]( configurations, and [*d3.js*]( to implement interactive features and animations.

# Further Reading

* The motivations for *Blast Radius* are documented in a series of [blog]( posts: [part 1](, [part 2](, and [part 3](
* A catalog of example *Terraform* configurations, and their dependency graphs can be found at [](

Project details

Download files

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

Files for BlastRadius, version 0.1.7
Filename, size File type Python version Upload date Hashes
Filename, size BlastRadius-0.1.7.tar.gz (210.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page