Skip to content

Commit b0aa8a4

Browse files
authored
use templatefile() (#2423)
1 parent 0efec8b commit b0aa8a4

File tree

1 file changed

+3
-9
lines changed
  • _examples/google-gke-nfs-filestore

1 file changed

+3
-9
lines changed

_examples/google-gke-nfs-filestore/main.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,16 @@ resource "google_filestore_instance" "test" {
9292
}
9393
}
9494

95-
data "template_file" "kubeconfig" {
96-
template = file("${path.module}/kubeconfig-template.yaml")
97-
98-
vars = {
95+
resource "local_file" "kubeconfig" {
96+
content = templatefile("${path.module}/kubeconfig-template.yaml",{
9997
cluster_name = google_container_cluster.primary.name
10098
user_name = google_container_cluster.primary.master_auth[0].username
10199
user_password = google_container_cluster.primary.master_auth[0].password
102100
endpoint = google_container_cluster.primary.endpoint
103101
cluster_ca = google_container_cluster.primary.master_auth[0].cluster_ca_certificate
104102
client_cert = google_container_cluster.primary.master_auth[0].client_certificate
105103
client_cert_key = google_container_cluster.primary.master_auth[0].client_key
106-
}
107-
}
108-
109-
resource "local_file" "kubeconfig" {
110-
content = data.template_file.kubeconfig.rendered
104+
})
111105
filename = "${path.module}/kubeconfig"
112106
}
113107

0 commit comments

Comments
 (0)