<p>I am using Terraform script to spin up a GKE cluster and then use helm 3 to install splunk connector on the cluster. </p>

<p>How do I connect to the newly created cluster in terraform kubernetes provider dynamically ? </p>

Spartan87
<p>Let the provider depend on the cluster certificate: </p>

<pre><code>data "google_client_config" "terraform_config" {
  provider = google
}

provider "kubernetes" {
  load_config_file = false
  host = "https://${google_container_cluster.my_cluster.endpoint}"
  cluster_ca_certificate = base64decode(google_container_cluster.my_cluster.master_auth[0].cluster_ca_certificate)
  token = data.google_client_config.terraform_config.access_token
}

</code></pre>
