28mm / blast-radius

Interactive visualizations of Terraform dependency graphs using d3.js
https://28mm.github.io/blast-radius-docs/
MIT License
2.04k stars 257 forks source link

Feature: presenting terraform apply progress in realtime #17

Open m4h3 opened 6 years ago

m4h3 commented 6 years ago

I've been following this project from the beginning and this is very interesting. You've thought about this before in a blog post : It would be nice to have an option to monitor the terraform state file and mutate the graph when things are getting deployed.

I'm wondering how the current architecture is ready for this.

28mm commented 6 years ago

Hi @m4h3 -- you raise some interesting issues :) My somewhat disorganized thoughts follow below.

Right now, blast-radius parses terraform graph to learn about the graph, so in a certain sense it only knows about the future--i.e. what the current state would be if terraform apply were run.

To learn about the deployment's current state, it would need to be able to parse .tfstate files, and assemble a graph from that.

I think dynamic mutations will be very hard, unless the initial and final states are known. This difficulty arises because blast-radius relies on graphviz for layout. Small changes to a graph can lead graphviz to wildly alter its layout, so it would be dizzying to watch terraform apply execute, for instance.

However, if initial and end states are known (by comparing.tfstate with terraform graph) it becomes possible to do a layout that includes everything, and simply reveal elements as they're instantiated in the cloud. I'm optimistic about this approach.

Some possible 1st steps

Anyway, those are some thoughts so far--I'll probably return with revisions. Let me know if I can clarify any particular point.