You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New datasource: google_container_cluster (hashicorp#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
Get info about a cluster within GKE from its name and zone.
12
+
13
+
## Example Usage
14
+
15
+
```tf
16
+
data "google_container_cluster" "my_cluster" {
17
+
name = "my-cluster"
18
+
zone = "us-east1-a"
19
+
}
20
+
21
+
output "cluster_username" {
22
+
value = "${data.google_container_cluster.my_cluster.master_auth.0.username}"
23
+
}
24
+
25
+
output "cluster_password" {
26
+
value = "${data.google_container_cluster.my_cluster.master_auth.0.password}"
27
+
}
28
+
29
+
output "endpoint" {
30
+
value = "${data.google_container_cluster.my_cluster.endpoint}"
31
+
}
32
+
33
+
output "instance_group_urls" {
34
+
value = "${data.google_container_cluster.my_cluster.instance_group_urls}"
35
+
}
36
+
37
+
output "node_config" {
38
+
value = "${data.google_container_cluster.my_cluster.node_config}"
39
+
}
40
+
41
+
output "node_pools" {
42
+
value = "${data.google_container_cluster.my_cluster.node_pool}"
43
+
}
44
+
```
45
+
46
+
## Argument Reference
47
+
48
+
The following arguments are supported:
49
+
50
+
*`name` - The name of the cluster.
51
+
52
+
*`zone` - The zones this cluster has been created in.
53
+
54
+
- - -
55
+
56
+
*`project` - (Optional) The project in which the resource belongs. If it
57
+
is not provided, the provider project is used.
58
+
59
+
## Attributes Reference
60
+
61
+
See [google_container_cluster](https://www.terraform.io/docs/providers/google/r/container_cluster.html) resource for details of the available attributes.
0 commit comments