Skip to content

Commit

Permalink
Fix outputs and tidy code
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredfholgate committed Dec 11, 2024
1 parent 040467f commit aaba94c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/platform_landing_zone/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ locals {
}

locals {
connectivity_enabled = var.connectivity_type != local.const.connectivity.none
connectivity_virtual_wan_enabled = var.connectivity_type == local.const.connectivity.virtual_wan
connectivity_hub_and_spoke_vnet_enabled = var.connectivity_type == local.const.connectivity.hub_and_spoke_vnet
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "dns_server_ip_addresses" {
value = { for key, value in local.virtual_hubs : key => try(module.hub_and_spoke_vnet.firewall_ip_addresses_by_hub_key[key].private_ip_address, null) }
value = { for key, value in local.virtual_hubs : key => try(module.virtual_wan.firewall_ip_addresses_by_hub_key[key].private_ip_address, null) }
}
2 changes: 1 addition & 1 deletion templates/platform_landing_zone/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "dns_server_ip_addresses" {
value = var.connectivity_type == "none" ? {} : (var.connectivity_type == "hub-and-spoke" ? module.hub_and_spoke_vnet.dns_server_ip_addresses : module.virtual_wan.dns_server_ip_addresses)
value = local.connectivity_enabled ? (local.connectivity_hub_and_spoke_vnet_enabled ? module.hub_and_spoke_vnet[0].dns_server_ip_addresses : module.virtual_wan[0].dns_server_ip_addresses) : {}
}

0 comments on commit aaba94c

Please sign in to comment.