Skip to content

Commit

Permalink
adds tf_graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Gohlke committed Jan 26, 2024
1 parent a219764 commit 08b8f72
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ function tf_plan {
fi
}

tf_graph() {
local plan=$(mktemp)
local graph=$(mktemp)
local image=$(mktemp)

terraform plan -out "$plan" $*
terraform graph -plan="$plan" -draw-cycles > "$graph"

dot -Tpng -o "${image}.png" "$graph"
open "${image}.png"
}

function tf_test {
if [[ ! -d tests ]]; then
read -r -p "Want to create a tests directory? (y/n) : " -n 1 reply
Expand Down

0 comments on commit 08b8f72

Please sign in to comment.