This is a very simple dependency graph from a template, I am not a "jq" expert so it might be slightly limited.
-
Obtain stack template
aws --region=eu-west-1 --profile=... cloudformation get-template --stack-name ...-... > ~/template-3 -
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 -
Create graph image