From 5b457cc505da15e183d8c5c5a5a5208e82ec3ff4 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 14 Aug 2018 15:55:45 +0200 Subject: [PATCH] MON-273 add script to auto add filter tag module --- scripts/03_update_module.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/03_update_module.sh diff --git a/scripts/03_update_module.sh b/scripts/03_update_module.sh new file mode 100755 index 0000000..c5adb5f --- /dev/null +++ b/scripts/03_update_module.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -xueo pipefail + +source "$(dirname $0)/utils.sh" +goto_root + +for path in $(find "$(get_scope $1)" -path ./incubator -prune -o -name 'monitors-*.tf' -print); do + cd $(dirname $path) + resource="$(basename $(dirname $path))" + if ! [ -f modules.tf ] && grep -q filter_tags_use_defaults inputs.tf; then + cat > modules.tf <> /dev/null +done +terraform fmt "$(get_scope $1)"