diff --git a/tpl/gcp/environment/gcs.tf.tt b/tpl/gcp/environment/gcs.tf.tt index 7626286..0e4566c 100644 --- a/tpl/gcp/environment/gcs.tf.tt +++ b/tpl/gcp/environment/gcs.tf.tt @@ -10,7 +10,7 @@ terraform { # Store .tfstate in a GCS bucket data "terraform_remote_state" "tfstate" { backend = "gcs" - config { + config = { bucket = "<%= @cloud['gcp']['bucket_name'] %>" path = "<%= @env_name %>-terraform.tfstate" project = "<%= @cloud['gcp']['project'] %>" diff --git a/tpl/gcp/environment/main.tf.tt b/tpl/gcp/environment/main.tf.tt index 5c919de..2f04522 100644 --- a/tpl/gcp/environment/main.tf.tt +++ b/tpl/gcp/environment/main.tf.tt @@ -1,6 +1,9 @@ provider "google" { - credentials = "${file("<%= @cloud['gcp']['service_account'] %>")}" - project = "<%= @cloud['gcp']['project'] %>" - region = "<%= @cloud['region'] %>" - version = "2.12.0" + credentials = file("<%= @cloud['gcp']['service_account'] %>") + project = "<%= @cloud['gcp']['project'] %>" + region = "<%= @cloud['region'] %>" +} + +terraform { + required_version = ">= 0.12" } diff --git a/tpl/gcp/environment/outputs.tf.tt b/tpl/gcp/environment/outputs.tf.tt index b531360..00f0e89 100644 --- a/tpl/gcp/environment/outputs.tf.tt +++ b/tpl/gcp/environment/outputs.tf.tt @@ -1,5 +1,5 @@ output service_account_b64 { - description = "GCloud service account key" - value = "${base64encode(file("<%= @cloud['gcp']['service_account'] %>"))}" + description = "Google Cloud service account key" + value = base64encode(file("<%= @cloud['gcp']['service_account'] %>")) sensitive = true }