From 14a0536bbcfeb89dc1af21f8fef0cb46affdc52e Mon Sep 17 00:00:00 2001 From: Marko Klemetti Date: Mon, 10 Jan 2022 19:24:19 +0200 Subject: [PATCH] fix: Removed dependency to obsolete template_file by upgrading to templatefile (#1119) * feat(auth): change template_file to templatefile * fix(auth): update value to follow terraform fmt --- modules/auth/main.tf | 11 ----------- modules/auth/outputs.tf | 7 ++++++- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/modules/auth/main.tf b/modules/auth/main.tf index 85612ee95..84e37c82a 100644 --- a/modules/auth/main.tf +++ b/modules/auth/main.tf @@ -30,14 +30,3 @@ data "google_container_cluster" "gke_cluster" { } data "google_client_config" "provider" {} - -data "template_file" "kubeconfig" { - template = file("${path.module}/templates/kubeconfig-template.yaml.tpl") - - vars = { - context = local.context - cluster_ca_certificate = local.cluster_ca_certificate - endpoint = local.endpoint - token = data.google_client_config.provider.access_token - } -} diff --git a/modules/auth/outputs.tf b/modules/auth/outputs.tf index 5f25a316f..7c9eea0a8 100644 --- a/modules/auth/outputs.tf +++ b/modules/auth/outputs.tf @@ -19,7 +19,12 @@ output "kubeconfig_raw" { sensitive = true description = "A kubeconfig file configured to access the GKE cluster." - value = data.template_file.kubeconfig.rendered + value = templatefile("${path.module}/templates/kubeconfig-template.yaml.tpl", { + context = local.context + cluster_ca_certificate = local.cluster_ca_certificate + endpoint = local.endpoint + token = data.google_client_config.provider.access_token + }) } # Terraform providers (kubernetes, helm)