Skip to content

Commit

Permalink
fix: Add cluster ID to outputs (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrarimarco committed May 5, 2021
1 parent 687dc71 commit fc34eb6
Show file tree
Hide file tree
Showing 28 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Then perform the following commands on the root folder:
| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cluster\_id | Cluster ID |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
Expand Down
3 changes: 3 additions & 0 deletions autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

{{ autogeneration_note }}

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
5 changes: 5 additions & 0 deletions autogen/safer-cluster/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

{{ autogeneration_note }}

output "cluster_id" {
description = "Cluster ID"
value = module.gke.cluster_id
}

output "name" {
description = "Cluster name"
value = module.gke.name
Expand Down
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ Then perform the following commands on the root folder:
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cloudrun\_enabled | Whether CloudRun enabled |
| cluster\_id | Cluster ID |
| dns\_cache\_enabled | Whether DNS Cache enabled |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ Then perform the following commands on the root folder:
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cloudrun\_enabled | Whether CloudRun enabled |
| cluster\_id | Cluster ID |
| dns\_cache\_enabled | Whether DNS Cache enabled |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ Then perform the following commands on the root folder:
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cloudrun\_enabled | Whether CloudRun enabled |
| cluster\_id | Cluster ID |
| dns\_cache\_enabled | Whether DNS Cache enabled |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-public-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-public-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Then perform the following commands on the root folder:
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cloudrun\_enabled | Whether CloudRun enabled |
| cluster\_id | Cluster ID |
| dns\_cache\_enabled | Whether DNS Cache enabled |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Then perform the following commands on the root folder:
| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cluster\_id | Cluster ID |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ Then perform the following commands on the root folder:
| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cluster\_id | Cluster ID |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
Expand Down
3 changes: 3 additions & 0 deletions modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "random_shuffle" "available_zones" {
}

locals {
// ID of the cluster
cluster_id = google_container_cluster.primary.id

// location
location = var.regional ? var.region : var.zones[0]
region = var.regional ? var.region : join("-", slice(split("-", var.zones[0]), 0, 2))
Expand Down
5 changes: 5 additions & 0 deletions modules/private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down
1 change: 1 addition & 0 deletions modules/safer-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ For simplicity, we suggest using `roles/container.admin` and
| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cluster\_id | Cluster ID |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
Expand Down
5 changes: 5 additions & 0 deletions modules/safer-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

// This file was automatically generated from a template in ./autogen/safer-cluster

output "cluster_id" {
description = "Cluster ID"
value = module.gke.cluster_id
}

output "name" {
description = "Cluster name"
value = module.gke.name
Expand Down
1 change: 1 addition & 0 deletions modules/safer-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ For simplicity, we suggest using `roles/container.admin` and
| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cluster\_id | Cluster ID |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
Expand Down
5 changes: 5 additions & 0 deletions modules/safer-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

// This file was automatically generated from a template in ./autogen/safer-cluster

output "cluster_id" {
description = "Cluster ID"
value = module.gke.cluster_id
}

output "name" {
description = "Cluster name"
value = module.gke.name
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

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

output "cluster_id" {
description = "Cluster ID"
value = local.cluster_id
}

output "name" {
description = "Cluster name"
value = local.cluster_name
Expand Down

0 comments on commit fc34eb6

Please sign in to comment.