From 6e66b371426272a8ec939aeaf6ececb0dfe7bcf2 Mon Sep 17 00:00:00 2001 From: vshatravenko Date: Tue, 3 Apr 2018 00:32:24 +0300 Subject: [PATCH] Added automatical GCP credential load in kite terraform --- README.md | 6 ------ lib/kite/terraform.rb | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 3c5a8b7..c0c6a33 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,6 @@ Fill in `vars.*module_name*.yml` with correct values and render the module: ### Apply Terraform configuration from the environment -Set your default gcloud credentials using - -``` - gcloud auth application-default login -``` - ``` kite terraform init kite terraform apply --env *env_name* diff --git a/lib/kite/terraform.rb b/lib/kite/terraform.rb index 5b62ee1..a4aa2ab 100644 --- a/lib/kite/terraform.rb +++ b/lib/kite/terraform.rb @@ -26,8 +26,7 @@ def load_env STDERR.puts "%-25s: %s" % [key, ENV["TF_VAR_#{var}"]] end - # TODO: Need to be set only in case of GCP - # ENV['GOOGLE_APPLICATION_CREDENTIALS'] = @vars["credentials"] + ENV['GOOGLE_APPLICATION_CREDENTIALS'] = File.expand_path(@vars["service_account"]) if cloud.key? 'gcp' end def cloud