Skip to content

Commit

Permalink
Make GKE module cluster_name computed attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Naser committed Mar 25, 2022
1 parent 9f06ef4 commit baa6f7a
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 1 deletion.
10 changes: 10 additions & 0 deletions autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal_with_asm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data "google_project" "project" {
module "gke" {
source = "../../"
project_id = var.project_id
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
name = "test-prefix-cluster-test-suffix"
regional = false
region = var.region
zones = var.zones
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-autopilot-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-autopilot-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-public-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-public-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions modules/private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ output "cluster_id" {
output "name" {
description = "Cluster name"
value = local.cluster_name
depends_on = [
/* Nominally, the cluster name is populated as soon as it is known to Terraform.
* However, the cluster may not be in a usable state yet. Therefore any
* resources dependent on the cluster being up will fail to deploy. With
* this explicit dependency, dependent resources can wait for the cluster
* to be up.
*/
google_container_cluster.primary,
google_container_node_pool.pools,
]
}

output "type" {
Expand Down

0 comments on commit baa6f7a

Please sign in to comment.