|
@@ -7,7 +7,7 @@ function argparse {
|
|
|
while (( "$#" )); do
|
|
|
case "$1" in
|
|
|
-h|--help)
|
|
|
- echo Usage: $0 '[-l|--local] [-t|--test] [-s|--skipqualys] [-d|--debug]'
|
|
|
+ echo Usage: $0 '[-r|--refresh] [-l|--local] [-t|--test] [-s|--skipqualys] [-d|--debug]'
|
|
|
exit 0
|
|
|
;;
|
|
|
-t|--test)
|
|
@@ -27,6 +27,13 @@ function argparse {
|
|
|
DEBUG=1
|
|
|
shift
|
|
|
;;
|
|
|
+ -r|--refresh)
|
|
|
+ # Refresh "refreshes" the state from the aws api, even if the configuration seemingly
|
|
|
+ # matches what's on disk. For example, after an upgrade to terraform where they've added
|
|
|
+ # support for a new configuration item.
|
|
|
+ REFRESH="-refresh-only"
|
|
|
+ shift
|
|
|
+ ;;
|
|
|
-s|--skipqualys)
|
|
|
SKIPQUALYS=1
|
|
|
shift
|
|
@@ -131,7 +138,7 @@ for i in `seq -f "%g*" 0 9 | sort -n`; do
|
|
|
cd $i
|
|
|
[[ $TESTING ]] && ${TERRAGRUNT_BIN} plan # Run a plan if testing
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} init # Run an init and apply
|
|
|
- [[ $TESTING ]] || ${TERRAGRUNT_BIN} apply
|
|
|
+ [[ $TESTING ]] || ${TERRAGRUNT_BIN} apply ${REFRESH}
|
|
|
EXITCODE=$?
|
|
|
popd > /dev/null
|
|
|
echo "========== Region completed: $i"
|
|
@@ -143,7 +150,7 @@ for i in `seq -f "%g*" 0 9 | sort -n`; do
|
|
|
else
|
|
|
[[ $TESTING ]] && ${TERRAGRUNT_BIN} plan # Run a plan if testing
|
|
|
[[ $TESTING ]] || ${TERRAGRUNT_BIN} init # Run an init and apply otherwise
|
|
|
- [[ $TESTING ]] || ${TERRAGRUNT_BIN} apply
|
|
|
+ [[ $TESTING ]] || ${TERRAGRUNT_BIN} apply ${REFRESH}
|
|
|
EXITCODE=$?
|
|
|
fi
|
|
|
popd > /dev/null
|