-
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.
Merge pull request #5 from mineiros-io/mariux/fix-terraform-aws-modul…
…e-validation fix terraform aws module validation
- Loading branch information
Showing
3 changed files
with
11 additions
and
18 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# set -e is considered to be a bad practice as written here http://mywiki.wooledge.org/BashFAQ/105 | ||
# so we use a trap instead | ||
trap 'exit' ERR | ||
|
||
# Make environment variables working in OSX GUI apps such as Github Desktop https://stackoverflow.com/q/135688/483528 | ||
# Make environment variables working in OSX GUI apps such as Github Desktop | ||
# https://stackoverflow.com/q/135688/483528 | ||
export PATH=$PATH:/usr/local/bin | ||
|
||
terraform fmt -recursive | ||
|
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 |
---|---|---|
@@ -1,16 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# set -e is considered to be a bad practice as written here http://mywiki.wooledge.org/BashFAQ/105 | ||
# so we use a trap instead | ||
trap 'exit' ERR | ||
|
||
# Make environment variables working in OSX GUI apps such as Github Desktop https://stackoverflow.com/q/135688/483528 | ||
# Make environment variables working in OSX GUI apps such as Github Desktop | ||
# https://stackoverflow.com/q/135688/483528 | ||
export PATH=$PATH:/usr/local/bin | ||
|
||
# set default aws region for validating aws providers | ||
export AWS_REGION=${AWS_REGION:="none"} | ||
|
||
for dir in $(echo "$@" | xargs -n1 dirname | sort -u | uniq); do | ||
while read dir; do | ||
terraform init -backend=false "$dir" | ||
terraform validate "$dir" | ||
done | ||
done < <(printf '%s\n' "${@%/*}" | sort -u) |