Skip to content

Commit fc34eb6

Browse files
authored
fix: Add cluster ID to outputs (#886)
1 parent 687dc71 commit fc34eb6

File tree

28 files changed

+88
-0
lines changed

28 files changed

+88
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Then perform the following commands on the root folder:
195195
| Name | Description |
196196
|------|-------------|
197197
| ca\_certificate | Cluster ca certificate (base64 encoded) |
198+
| cluster\_id | Cluster ID |
198199
| endpoint | Cluster endpoint |
199200
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
200201
| http\_load\_balancing\_enabled | Whether http load balancing enabled |

autogen/main/main.tf.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ resource "random_shuffle" "available_zones" {
3636
}
3737

3838
locals {
39+
// ID of the cluster
40+
cluster_id = google_container_cluster.primary.id
41+
3942
// location
4043
location = var.regional ? var.region : var.zones[0]
4144
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
{{ autogeneration_note }}
1818

19+
output "cluster_id" {
20+
description = "Cluster ID"
21+
value = local.cluster_id
22+
}
23+
1924
output "name" {
2025
description = "Cluster name"
2126
value = local.cluster_name

autogen/safer-cluster/outputs.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
{{ autogeneration_note }}
1818

19+
output "cluster_id" {
20+
description = "Cluster ID"
21+
value = module.gke.cluster_id
22+
}
23+
1924
output "name" {
2025
description = "Cluster name"
2126
value = module.gke.name

main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
3232
}
3333

3434
locals {
35+
// ID of the cluster
36+
cluster_id = google_container_cluster.primary.id
37+
3538
// location
3639
location = var.regional ? var.region : var.zones[0]
3740
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ Then perform the following commands on the root folder:
253253
|------|-------------|
254254
| ca\_certificate | Cluster ca certificate (base64 encoded) |
255255
| cloudrun\_enabled | Whether CloudRun enabled |
256+
| cluster\_id | Cluster ID |
256257
| dns\_cache\_enabled | Whether DNS Cache enabled |
257258
| endpoint | Cluster endpoint |
258259
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |

modules/beta-private-cluster-update-variant/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
3232
}
3333

3434
locals {
35+
// ID of the cluster
36+
cluster_id = google_container_cluster.primary.id
37+
3538
// location
3639
location = var.regional ? var.region : var.zones[0]
3740
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))

modules/beta-private-cluster-update-variant/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
// This file was automatically generated from a template in ./autogen/main
1818

19+
output "cluster_id" {
20+
description = "Cluster ID"
21+
value = local.cluster_id
22+
}
23+
1924
output "name" {
2025
description = "Cluster name"
2126
value = local.cluster_name

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ Then perform the following commands on the root folder:
231231
|------|-------------|
232232
| ca\_certificate | Cluster ca certificate (base64 encoded) |
233233
| cloudrun\_enabled | Whether CloudRun enabled |
234+
| cluster\_id | Cluster ID |
234235
| dns\_cache\_enabled | Whether DNS Cache enabled |
235236
| endpoint | Cluster endpoint |
236237
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |

modules/beta-private-cluster/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
3232
}
3333

3434
locals {
35+
// ID of the cluster
36+
cluster_id = google_container_cluster.primary.id
37+
3538
// location
3639
location = var.regional ? var.region : var.zones[0]
3740
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))

0 commit comments

Comments
 (0)