Skip to content

Commit

Permalink
Remove intermediary variables
Browse files Browse the repository at this point in the history
They seem to cause errors when the
master_authorized_networks_config is empty
  • Loading branch information
pratikmallya committed Sep 19, 2018
1 parent c0b223a commit 365c6fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
26 changes: 10 additions & 16 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ locals {
zonal = "${element(concat(google_container_cluster.zonal_primary.*.min_master_version, list("")), 0)}"
}

cluster_type_output_master_authorized_networks_config = {
regional = "${element(concat(google_container_cluster.primary.*.master_authorized_networks_config, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.master_authorized_networks_config, list("")), 0)}"
}

cluster_type_output_network_policy_enabled = {
regional = "${element(concat(google_container_cluster.primary.*.addons_config.0.network_policy_config.0.disabled, list("")), 0)}"
zonal = "${element(concat(google_container_cluster.zonal_primary.*.addons_config.0.network_policy_config.0.disabled, list("")), 0)}"
Expand Down Expand Up @@ -113,17 +108,16 @@ locals {
cluster_master_auth_map = "${local.cluster_master_auth_list_layer2[0]}"

# cluster locals
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_master_authorized_networks_config = "${local.cluster_type_output_master_authorized_networks_config[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"
cluster_name = "${local.cluster_type_output_name[local.cluster_type]}"
cluster_location = "${local.cluster_type_output_location[local.cluster_type]}"
cluster_region = "${local.cluster_type_output_region[local.cluster_type]}"
cluster_zones = "${sort(local.cluster_type_output_zones[local.cluster_type])}"
cluster_endpoint = "${local.cluster_type_output_endpoint[local.cluster_type]}"
cluster_ca_certificate = "${lookup(local.cluster_master_auth_map, "cluster_ca_certificate")}"
cluster_master_version = "${local.cluster_type_output_master_version[local.cluster_type]}"
cluster_min_master_version = "${local.cluster_type_output_min_master_version[local.cluster_type]}"
cluster_node_pools_names = "${local.cluster_type_output_node_pools_names[local.cluster_type]}"
cluster_node_pools_versions = "${local.cluster_type_output_node_pools_versions[local.cluster_type]}"

cluster_network_policy_enabled = "${local.cluster_type_output_network_policy_enabled[local.cluster_type] ? false : true}"
cluster_http_load_balancing_enabled = "${local.cluster_type_output_http_load_balancing_enabled[local.cluster_type] ? false : true}"
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ output "min_master_version" {

output "master_authorized_networks_config" {
description = "Networks from which access to master is permitted"
value = "${local.cluster_master_authorized_networks_config}"
value = "${var.master_authorized_networks_config}"
}

output "master_version" {
Expand Down

0 comments on commit 365c6fe

Please sign in to comment.