-
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.
Refactor docs and cmd.version variable
- Loading branch information
1 parent
2944ff3
commit 728e7d5
Showing
6 changed files
with
70 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,4 @@ dist/ | |
internal/utils/markdown_render/docs/ | ||
|
||
# OSX | ||
.DS_Store | ||
.DS_Store |
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
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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
|
||
- [Usage](#usage) | ||
- [Summarize](#summarize) | ||
- [Function for ~/.zshrc](#function-for-zshrc) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# Usage | ||
|
||
## Summarize | ||
|
||
```bash | ||
terraform plan -out plan.tfplan | ||
terraform show -json plan.tfplan | tftools summarize | ||
``` | ||
|
||
Or if you have the file in json | ||
|
||
```bash | ||
terraform plan -out plan.tfplan | ||
terraform show -json plan.tfplan > plan.json | ||
cat plan.json | tftools summarize | ||
``` | ||
|
||
## Function for ~/.zshrc | ||
|
||
Copy [this function](../scripts/tfsum.sh) in your `~/.zshrc` or `~/.bashrc` file. | ||
|
||
```bash | ||
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\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 | ||
} | ||
``` | ||
|
||
```bash | ||
source ~/.zshrc | ||
tfsum terragrunt or tfsum terraform | ||
``` |