I am using Terraform script to spin up a GKE cluster and then use helm 3 to install splunk connector on the cluster.
How do I connect to the newly created cluster in terraform kubernetes provider dynamically ?
Let the provider depend on the cluster certificate:
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
}