Skip to content

Instantly share code, notes, and snippets.

@joemiller
Last active January 6, 2022 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemiller/ba84c2d615c0b4998466d43a64c9dce7 to your computer and use it in GitHub Desktop.
Save joemiller/ba84c2d615c0b4998466d43a64c9dce7 to your computer and use it in GitHub Desktop.
terragrunt wrapper to leverage bash/zsh shell globbing support for the run-all command set
#!/bin/bash
#
# uber simple wrapper to leverage bash/zsh shell globbing support with terragrunt's `--terragrunt-include-dir=` flag.
set -eou pipefail
[[ -n "${DEBUG:-}" ]] && set -x
if [[ "$#" -lt 2 ]]; then
echo "Usage: $0 [init|plan|apply] GLOB"
exit 1
fi
cmd="$1"
shift
glob=("$@")
exec terragrunt run-all "$cmd" --terragrunt-log-level=info "${glob[@]/#/--terragrunt-include-dir=}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment