From 5c8ba69da752ce2e185f70134da42339c31ca2b0 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Thu, 27 Jun 2019 13:29:59 +0200 Subject: [PATCH] MON-459 update terraform ci script to handle O.12 behavior --- scripts/99_terraform.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/99_terraform.sh b/scripts/99_terraform.sh index 346c9e1..534c33a 100755 --- a/scripts/99_terraform.sh +++ b/scripts/99_terraform.sh @@ -6,8 +6,29 @@ goto_root for path in $(find "$(get_scope $1)" -name 'inputs.tf' -print); do dir=$(dirname ${path}) - terraform init ${dir} >> /dev/null 2>&1 - terraform validate -check-variables=false ${dir} + cd $dir + cat < 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 -terraform fmt +terraform fmt -recursive