MON-459 avoid create .terraform directory for each module

This commit is contained in:
Quentin Manfroi 2019-06-27 14:06:50 +02:00
parent 5f2883546a
commit 6f83f0ddc9

View File

@ -6,8 +6,7 @@ goto_root
for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do
dir=$(dirname ${path})
cd $dir
cat <<EOF > tmp.tf
cat <<EOF > ${dir}/tmp.tf
provider "datadog" {
version = "2.0.2"
@ -25,10 +24,9 @@ variable "datadog_app_key" {
default = "yyy"
}
EOF
terraform init
terraform validate
rm -f tmp.tf
cd -
terraform init ${dir}
terraform validate ${dir}
rm -f ${dir}/tmp.tf
done
terraform fmt -recursive