Skip to content

Commit 67f8a5f

Browse files
authored
Merge pull request #214 from kevensen/output-updates
Changed the endpoint variable to be dependent on GKE cluster state
2 parents 0895eee + 24a3681 commit 67f8a5f

File tree

5 files changed

+68
-0
lines changed

5 files changed

+68
-0
lines changed

autogen/outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ output "endpoint" {
4545
sensitive = true
4646
description = "Cluster endpoint"
4747
value = local.cluster_endpoint
48+
depends_on = [
49+
/* Nominally, the endpoint is populated as soon as it is known to Terraform.
50+
* However, the cluster may not be in a usable state yet. Therefore any
51+
* resources dependent on the cluster being up will fail to deploy. With
52+
* this explicit dependency, dependent resources can wait for the cluster
53+
* to be up.
54+
*/
55+
google_container_cluster.primary,
56+
google_container_node_pool.pools,
57+
google_container_cluster.zonal_primary,
58+
google_container_node_pool.zonal_pools,
59+
]
4860
}
4961

5062
output "min_master_version" {
@@ -112,6 +124,7 @@ output "service_account" {
112124
description = "The service account to default running nodes as if not overridden in `node_pools`."
113125
value = local.service_account
114126
}
127+
115128
{% if beta_cluster %}
116129

117130
output "istio_enabled" {
@@ -128,4 +141,5 @@ output "pod_security_policy_enabled" {
128141
description = "Whether pod security policy is enabled"
129142
value = local.cluster_pod_security_policy_enabled
130143
}
144+
131145
{% endif %}

modules/beta-private-cluster/outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ output "endpoint" {
4545
sensitive = true
4646
description = "Cluster endpoint"
4747
value = local.cluster_endpoint
48+
depends_on = [
49+
/* Nominally, the endpoint is populated as soon as it is known to Terraform.
50+
* However, the cluster may not be in a usable state yet. Therefore any
51+
* resources dependent on the cluster being up will fail to deploy. With
52+
* this explicit dependency, dependent resources can wait for the cluster
53+
* to be up.
54+
*/
55+
google_container_cluster.primary,
56+
google_container_node_pool.pools,
57+
google_container_cluster.zonal_primary,
58+
google_container_node_pool.zonal_pools,
59+
]
4860
}
4961

5062
output "min_master_version" {
@@ -113,6 +125,7 @@ output "service_account" {
113125
value = local.service_account
114126
}
115127

128+
116129
output "istio_enabled" {
117130
description = "Whether Istio is enabled"
118131
value = local.cluster_istio_enabled
@@ -127,3 +140,4 @@ output "pod_security_policy_enabled" {
127140
description = "Whether pod security policy is enabled"
128141
value = local.cluster_pod_security_policy_enabled
129142
}
143+

modules/beta-public-cluster/outputs.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ output "endpoint" {
4545
sensitive = true
4646
description = "Cluster endpoint"
4747
value = local.cluster_endpoint
48+
depends_on = [
49+
/* Nominally, the endpoint is populated as soon as it is known to Terraform.
50+
* However, the cluster may not be in a usable state yet. Therefore any
51+
* resources dependent on the cluster being up will fail to deploy. With
52+
* this explicit dependency, dependent resources can wait for the cluster
53+
* to be up.
54+
*/
55+
google_container_cluster.primary,
56+
google_container_node_pool.pools,
57+
google_container_cluster.zonal_primary,
58+
google_container_node_pool.zonal_pools,
59+
]
4860
}
4961

5062
output "min_master_version" {
@@ -113,6 +125,7 @@ output "service_account" {
113125
value = local.service_account
114126
}
115127

128+
116129
output "istio_enabled" {
117130
description = "Whether Istio is enabled"
118131
value = local.cluster_istio_enabled
@@ -127,3 +140,4 @@ output "pod_security_policy_enabled" {
127140
description = "Whether pod security policy is enabled"
128141
value = local.cluster_pod_security_policy_enabled
129142
}
143+

modules/private-cluster/outputs.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ output "endpoint" {
4545
sensitive = true
4646
description = "Cluster endpoint"
4747
value = local.cluster_endpoint
48+
depends_on = [
49+
/* Nominally, the endpoint is populated as soon as it is known to Terraform.
50+
* However, the cluster may not be in a usable state yet. Therefore any
51+
* resources dependent on the cluster being up will fail to deploy. With
52+
* this explicit dependency, dependent resources can wait for the cluster
53+
* to be up.
54+
*/
55+
google_container_cluster.primary,
56+
google_container_node_pool.pools,
57+
google_container_cluster.zonal_primary,
58+
google_container_node_pool.zonal_pools,
59+
]
4860
}
4961

5062
output "min_master_version" {
@@ -112,3 +124,4 @@ output "service_account" {
112124
description = "The service account to default running nodes as if not overridden in `node_pools`."
113125
value = local.service_account
114126
}
127+

outputs.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ output "endpoint" {
4545
sensitive = true
4646
description = "Cluster endpoint"
4747
value = local.cluster_endpoint
48+
depends_on = [
49+
/* Nominally, the endpoint is populated as soon as it is known to Terraform.
50+
* However, the cluster may not be in a usable state yet. Therefore any
51+
* resources dependent on the cluster being up will fail to deploy. With
52+
* this explicit dependency, dependent resources can wait for the cluster
53+
* to be up.
54+
*/
55+
google_container_cluster.primary,
56+
google_container_node_pool.pools,
57+
google_container_cluster.zonal_primary,
58+
google_container_node_pool.zonal_pools,
59+
]
4860
}
4961

5062
output "min_master_version" {
@@ -112,3 +124,4 @@ output "service_account" {
112124
description = "The service account to default running nodes as if not overridden in `node_pools`."
113125
value = local.service_account
114126
}
127+

0 commit comments

Comments
 (0)