Skip to content

Instantly share code, notes, and snippets.

@filipposc5
Created July 4, 2016 15:24
Show Gist options
  • Select an option

  • Save filipposc5/9ee0bf1e25e0aff30c867cd2f612a39e to your computer and use it in GitHub Desktop.

Select an option

Save filipposc5/9ee0bf1e25e0aff30c867cd2f612a39e to your computer and use it in GitHub Desktop.
Visualising DependsOn dependency graph

Visualising dependency graph

This is a very simple dependency graph from a template, I am not a "jq" expert so it might be slightly limited.

  1. Obtain stack template aws --region=eu-west-1 --profile=... cloudformation get-template --stack-name ...-... > ~/template-3

  2. Create graph dot (echo digraph G \{ ; cat ~/template-3 | jq -r '.TemplateBody.Resources | keys[] as $k | select((.[$k] | .DependsOn) != null) | "\($k) -> \(.[$k] | .DependsOn);"'| tr -d \]\[ ; echo \} ) > DependsOn.dot

  3. Create graph image dot -Tpng DependsOn.dot -o DependsOn.png

Dependency graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment