@@ -96,8 +96,6 @@ locals {
9696{% endif %}
9797
9898 cluster_output_name = google_container_cluster.primary.name
99- cluster_output_location = google_container_cluster.primary.location
100- cluster_output_region = google_container_cluster.primary.region
10199 cluster_output_regional_zones = google_container_cluster.primary.node_locations
102100 cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
103101 cluster_output_zones = local.cluster_output_regional_zones
@@ -137,11 +135,12 @@ locals {
137135 cluster_master_auth_list_layer1 = local.cluster_output_master_auth
138136 cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
139137 cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
140- # cluster locals
138+
139+ cluster_location = google_container_cluster.primary.location
140+ cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
141+ cluster_zones = sort(local.cluster_output_zones)
142+
141143 cluster_name = local.cluster_output_name
142- cluster_location = local.cluster_output_location
143- cluster_region = local.cluster_output_region
144- cluster_zones = sort(local.cluster_output_zones)
145144 cluster_endpoint = local.cluster_output_endpoint
146145 cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
147146 cluster_master_version = local.cluster_output_master_version
0 commit comments