apply_module_everywhere 599 B

1234567891011121314151617181920212223
  1. #! /bin/bash
  2. #
  3. # Runs an init and apply in all copies of a module
  4. #
  5. # TODO: Would be really nice if this did some input validation, and if you
  6. # could specify 'local' or not.
  7. for i in $( find . -type d -name "$1" -print | egrep -v "000-skeleton" ); do
  8. echo ""
  9. echo ------------------------------------
  10. echo Processing $i...
  11. echo ------------------------------------
  12. pushd $i
  13. if [[ -f "../UNUSED.ACCOUNT" ]]; then
  14. echo $i is unused. Continuing.
  15. popd
  16. continue
  17. fi
  18. #echo terragrunt init && echo terragrunt apply
  19. terragrunt init --upgrade && terragrunt apply
  20. popd
  21. done