{"id":13402370,"url":"https://github.com/28mm/blast-radius","last_synced_at":"2025-04-11T11:48:25.040Z","repository":{"id":37271408,"uuid":"109790225","full_name":"28mm/blast-radius","owner":"28mm","description":"Interactive visualizations of Terraform dependency graphs using d3.js","archived":false,"fork":false,"pushed_at":"2024-08-14T12:38:03.000Z","size":1017,"stargazers_count":2105,"open_issues_count":47,"forks_count":258,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-03T15:07:16.418Z","etag":null,"topics":["diagram","graphviz","interactive-visualizations","terraform"],"latest_commit_sha":null,"homepage":"https://28mm.github.io/blast-radius-docs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/28mm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-07T05:20:23.000Z","updated_at":"2025-04-01T23:03:35.000Z","dependencies_parsed_at":"2024-01-03T02:28:29.396Z","dependency_job_id":"102ee6b9-8735-44ee-a8bd-21950b0bd1a6","html_url":"https://github.com/28mm/blast-radius","commit_stats":{"total_commits":96,"total_committers":15,"mean_commits":6.4,"dds":"0.47916666666666663","last_synced_commit":"a7ec4ef78141ab0d2a688c65112f799adb9622ba"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28mm%2Fblast-radius","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28mm%2Fblast-radius/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28mm%2Fblast-radius/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/28mm%2Fblast-radius/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/28mm","download_url":"https://codeload.github.com/28mm/blast-radius/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248388642,"owners_count":21095424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diagram","graphviz","interactive-visualizations","terraform"],"created_at":"2024-07-30T19:01:15.167Z","updated_at":"2025-04-11T11:48:25.012Z","avatar_url":"https://github.com/28mm.png","language":"JavaScript","readme":"# Blast Radius\n\n[![CircleCI](https://circleci.com/gh/28mm/blast-radius/tree/master.svg?style=svg)](https://circleci.com/gh/28mm/blast-radius/tree/master)\n[![PyPI version](https://badge.fury.io/py/BlastRadius.svg)](https://badge.fury.io/py/BlastRadius)\n\n[terraform]: https://www.terraform.io/\n[examples]: https://28mm.github.io/blast-radius-docs/\n\n_Blast Radius_ is a tool for reasoning about [Terraform][] dependency graphs\nwith interactive visualizations.\n\nUse _Blast Radius_ to:\n\n* __Learn__ about *Terraform* or one of its providers through real [examples][]\n* __Document__ your infrastructure\n* __Reason__ about relationships between resources and evaluate changes to them\n* __Interact__ with the diagram below (and many others) [in the docs][examples]\n\n![screenshot](doc/blastradius-interactive.png)\n\n## Prerequisites\n\n* [Graphviz](https://www.graphviz.org/)\n* [Python](https://www.python.org/) 3.7 or newer\n\n\u003e __Note:__ For macOS you can `brew install graphviz`\n\n## Quickstart\n\nThe fastest way to get up and running with *Blast Radius* is to install it with\n`pip` to your pre-existing environment:\n\n```sh\npip install blastradius\n```\n\nOnce installed just point *Blast Radius* at any initialized *Terraform*\ndirectory:\n\n```sh\nblast-radius --serve /path/to/terraform/directory\n```\n\nAnd you will shortly be rewarded with a browser link http://127.0.0.1:5000/.\n\n## Docker\n\n[privileges]: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities\n[overlayfs]: https://wiki.archlinux.org/index.php/Overlay_filesystem\n\nTo launch *Blast Radius* for a local directory by manually running:\n\n```sh\ndocker run --rm -it -p 5000:5000 \\\n  -v $(pwd):/data:ro \\\n  --security-opt apparmor:unconfined \\\n  --cap-add=SYS_ADMIN \\\n  28mm/blast-radius\n```\n\nA slightly more customized variant of this is also available as an example\n[docker-compose.yml](./examples/docker-compose.yml) usecase for Workspaces.\n\n### Docker configurations\n\n*Terraform* module links are saved as _absolute_ paths in relative to the\nproject root (note `.terraform/modules/\u003cuuid\u003e`). Given these paths will vary\nbetwen Docker and the host, we mount the volume as read-only, assuring we don't\never interfere with your real environment.\n\nHowever, in order for *Blast Radius* to actually work with *Terraform*, it needs\nto be initialized. To accomplish this, the container creates an [overlayfs][]\nthat exists within the container, overlaying your own, so that it can operate\nindependently. To do this, certain runtime privileges are required --\nspecifically `--cap-add=SYS_ADMIN`.\n\nFor more information on how this works and what it means for your host, check\nout the [runtime privileges][privileges] documentation.\n\n#### Docker \u0026 Subdirectories\n\nIf you organized your *Terraform* project using stacks and modules,\n*Blast Radius* must be called from the project root and reference them as\nsubdirectories -- don't forget to prefix `--serve`!\n\nFor example, let's create a Terraform `project` with the following:\n\n```txt\n$ tree -d\n`-- project/\n    |-- modules/\n    |   |-- foo\n    |   |-- bar\n    |   `-- dead\n    `-- stacks/\n        `-- beef/\n             `-- .terraform\n```\n\nIt consists of 3 modules `foo`, `bar` and `dead`, followed by one `beef` stack.\nTo apply *Blast Radius* to the `beef` stack, you would want to run the container\nwith the following:\n\n```sh\n$ cd project\n$ docker run --rm -it -p 5000:5000 \\\n    -v $(pwd):/data:ro \\\n    --security-opt apparmor:unconfined \\\n    --cap-add=SYS_ADMIN \\\n    28mm/blast-radius --serve stacks/beef\n```\n\n## Embedded Figures\n\nYou may wish to embed figures produced with *Blast Radius* in other documents.\nYou will need the following:\n\n1. An `svg` file and `json` document representing the graph and its layout.\n2. `javascript` and `css` found in `.../blastradius/server/static`\n3. A uniquely identified DOM element, where the `\u003csvg\u003e` should appear.\n\nYou can read more details in the [documentation](doc/embedded.md)\n\n## Implementation Details\n\n*Blast Radius* uses the [Graphviz][] package to layout graph diagrams,\n[PyHCL](https://github.com/virtuald/pyhcl) to parse [Terraform][] configuration,\nand [d3.js](https://d3js.org/) to implement interactive features and animations.\n\n## Further Reading\n\nThe development of *Blast Radius* is documented in a series of\n[blog](https://28mm.github.io) posts:\n\n* [part 1](https://28mm.github.io/notes/d3-terraform-graphs): motivations, d3 force-directed layouts vs. vanilla graphviz.\n* [part 2](https://28mm.github.io/notes/d3-terraform-graphs-2): d3-enhanced graphviz layouts, meaningful coloration, animations.\n* [part 3](https://28mm.github.io/notes/terraform-graphs-3): limiting horizontal sprawl, supporting modules.\n* [part 4](https://28mm.github.io/notes/d3-terraform-graphs-4): search, pan/zoom, prune-to-selection, docker.\n\nA catalog of example *Terraform* configurations, and their dependency graphs\ncan be found [here](https://28mm.github.io/blast-radius-docs/).\n\n* [AWS two-tier architecture](https://28mm.github.io/blast-radius-docs/examples/terraform-provider-aws/two-tier/)\n* [AWS networking (featuring modules)](https://28mm.github.io/blast-radius-docs/examples/terraform-provider-aws/networking/)\n* [Google two-tier architecture](https://28mm.github.io/blast-radius-docs/examples/terraform-provider-google/two-tier/)\n* [Azure load-balancing with 2 vms](https://28mm.github.io/blast-radius-docs/examples/terraform-provider-azurem/2-vms-loadbalancer-lbrules/)\n\nThese examples are drawn primarily from the `examples/` directory distributed\nwith various *Terraform* providers, and aren't necessarily ideal. Additional\nexamples, particularly demonstrations of best-practices, or of multi-cloud\nconfigurations strongly desired.\n","funding_links":[],"categories":["JavaScript","Tools","terraform","Terraform","\u003ca name=\"JavaScript\"\u003e\u003c/a\u003eJavaScript","Visual"],"sub_categories":["Miscellaneous","Community providers","Kubernetes // Storage","Datbase to Struct"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F28mm%2Fblast-radius","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F28mm%2Fblast-radius","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F28mm%2Fblast-radius/lists"}