MON-459 update terraform ci script to handle O.12 behavior

This commit is contained in:
Quentin Manfroi 2019-06-27 13:29:59 +02:00
parent c10a4da315
commit 5c8ba69da7

View File

@ -6,8 +6,29 @@ goto_root
for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do
dir=$(dirname ${path}) dir=$(dirname ${path})
terraform init ${dir} >> /dev/null 2>&1 cd $dir
terraform validate -check-variables=false ${dir} cat <<EOF > tmp.tf
provider "datadog" {
version = "2.0.2"
api_key = "\${var.datadog_api_key}"
app_key = "\${var.datadog_app_key}"
}
variable "datadog_api_key" {
type = string
default = "xxx"
}
variable "datadog_app_key" {
type = string
default = "yyy"
}
EOF
terraform init
terraform validate
rm -f tmp.tf
cd -
done done
terraform fmt terraform fmt -recursive