terraform-provider-google/website/docs/d/datasource_container_cluster.html.markdown
Matt Morrison 23ef50f5ca New datasource: google_container_cluster (#740)
* Add google_kubernetes_cluster datasource

Add documentation for google_kubernetes_cluster datasource

Rename datasource to google_container_cluster

To be consistent with the equivalent resource.

Rename datasource in docs.
google_kubernetes_cluster -> google_container_cluster.
Also add reference in google.erb file.

WIP

Datasource read needs to set an ID, then call resource read func

Add additional cluster attributes to datasource schema

* Generate datasource schema from resource

Datasource documentation also updated.

* add test for datasourceSchemaFromResourceSchema

* Code review changes
2017-12-20 13:21:11 -08:00

1.4 KiB

layout page_title sidebar_current description
google Google: google_container_cluster docs-google-datasource-container-cluster Get info about a Google Kubernetes cluster.

google_container_cluster

Get info about a cluster within GKE from its name and zone.

Example Usage

data "google_container_cluster" "my_cluster" {
  name   = "my-cluster"
  zone   = "us-east1-a"
}

output "cluster_username" {
  value = "${data.google_container_cluster.my_cluster.master_auth.0.username}"
}

output "cluster_password" {
  value = "${data.google_container_cluster.my_cluster.master_auth.0.password}"
}

output "endpoint" {
  value = "${data.google_container_cluster.my_cluster.endpoint}"
}

output "instance_group_urls" {
  value = "${data.google_container_cluster.my_cluster.instance_group_urls}"
}

output "node_config" {
  value = "${data.google_container_cluster.my_cluster.node_config}"
}

output "node_pools" {
  value = "${data.google_container_cluster.my_cluster.node_pool}"
}

Argument Reference

The following arguments are supported:

  • name - The name of the cluster.

  • zone - The zones this cluster has been created in.


  • project - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

See google_container_cluster resource for details of the available attributes.