Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute region output for zonal clusters #362

Merged
merged 3 commits into from
Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions autogen/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ locals {
{% endif %}

cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand Down Expand Up @@ -137,11 +135,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand All @@ -92,11 +90,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand Down Expand Up @@ -123,11 +121,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand Down Expand Up @@ -123,11 +121,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions modules/beta-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand Down Expand Up @@ -123,11 +121,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand All @@ -92,11 +90,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down
11 changes: 5 additions & 6 deletions modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ locals {


cluster_output_name = google_container_cluster.primary.name
cluster_output_location = google_container_cluster.primary.location
cluster_output_region = google_container_cluster.primary.region
cluster_output_regional_zones = google_container_cluster.primary.node_locations
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones
Expand All @@ -92,11 +90,12 @@ locals {
cluster_master_auth_list_layer1 = local.cluster_output_master_auth
cluster_master_auth_list_layer2 = local.cluster_master_auth_list_layer1[0]
cluster_master_auth_map = local.cluster_master_auth_list_layer2[0]
# cluster locals

cluster_location = google_container_cluster.primary.location
cluster_region = var.regional ? google_container_cluster.primary.region : join("-", slice(split("-", local.cluster_location), 0, 2))
cluster_zones = sort(local.cluster_output_zones)

cluster_name = local.cluster_output_name
cluster_location = local.cluster_output_location
cluster_region = local.cluster_output_region
cluster_zones = sort(local.cluster_output_zones)
cluster_endpoint = local.cluster_output_endpoint
cluster_ca_certificate = local.cluster_master_auth_map["cluster_ca_certificate"]
cluster_master_version = local.cluster_output_master_version
Expand Down