-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d2d931
commit 994d64f
Showing
4 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
function tfsum() { | ||
if [ -z "$1" ]; | ||
then | ||
echo "You should type 'tfsum terraform|terragrunt'" | ||
else | ||
echo -e "Starting tf summary..." | ||
# Don't print output of terraform plan | ||
# If you don't want full plan output: $1 plan -out plan.tfplan 1> /dev/null | ||
$1 plan -out plan.tfplan | ||
echo -e "\n" | ||
$1 show -json plan.tfplan | tftools summarize | ||
# Delete plan out file to avoid git tracking (although is included in .gitignore) | ||
if [ -f "plan.tfplan" ]; then rm plan.tfplan; fi | ||
fi | ||
} | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "You should type 'tfsum terraform|terragrunt'" | ||
exit 1 | ||
fi | ||
|
||
echo -en "Starting tf summary... Please wait" | ||
|
||
if [ -n "$2" ] && [ "$2" == "-v" ]; then | ||
"$1" plan -out plan.tfplan | ||
else | ||
"$1" plan -out plan.tfplan 1> /dev/null | ||
fi | ||
|
||
"$1" show -json plan.tfplan | tftools summarize --show-tags | ||
if [ -f "plan.tfplan" ]; then rm plan.tfplan; fi |