Open jdpribula opened 2 years ago
Hello
The google_composer_environment
has a field called config.0.gke_cluster
that you can pass to the google_container_cluster
datasource to lookup the GKE cluster using the GKE API.
data "google_container_cluster" "my_cluster" {
name = google_composer_environment.composer.config.0.gke_cluster
location = "europe-west6"
}
We're able to support these properties if they are exposed in the underlying API, however we don't feel it's appropriate to surface them in the provider without that being done. The managing API (i.e. composer) may decide to change the scope of management on the underlying API (i.e. GKE) at any time, and if Terraform attempts to manage the resource they'll encounter a conflict.
Workaround like using a datasource are possible as well, as an implementation detail of this managed service relationship, although are suboptimal compared to the API surfacing the fields directly in the management resource.
Community Note
Description
In the
google_container_cluster
resource you can reference themaster_auth
attributes among others to get auth credentials to the cluster. In thegoogle_composer_environment
resource all of the GKE attributes are not available.This means that in order to auth to the cluster we have to give a user or service account container admin access to the Composer GKE cluster in order to get this auth credential.
New or Affected Resource(s)
Potential Terraform Configuration
Expose the attribute.
References
0000