-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
31 lines (30 loc) · 1.28 KB
/
outputs.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
output "private_zones" {
description = "Contains all private DNS zones (new, existing, and predefined)"
value = merge(
# Regular private zones
{
for zone_key, zone in try(var.zones.private, {}) : zone_key => {
id = try(zone.use_existing_zone, false) ? try(data.azurerm_private_dns_zone.existing_zone[zone_key].id, null) : try(azurerm_private_dns_zone.zone[zone_key].id, null)
name = try(zone.use_existing_zone, false) ? try(data.azurerm_private_dns_zone.existing_zone[zone_key].name, null) : try(azurerm_private_dns_zone.zone[zone_key].name, null)
}
if !tobool(try(lookup(var.zones.private, "use_predefined_zones", false), false))
},
# Predefined zones
{
for name, zone in var.predefined_private_dns_zones : name => {
id = try(azurerm_private_dns_zone.zone[name].id, null)
name = try(azurerm_private_dns_zone.zone[name].name, null)
}
if tobool(try(lookup(var.zones.private, "use_predefined_zones", false), false))
}
)
}
output "public_zones" {
description = "Contains all public DNS zones"
value = {
for zone_key, zone in try(var.zones.public, {}) : zone_key => {
id = try(azurerm_dns_zone.this[zone_key].id, null)
name = try(azurerm_dns_zone.this[zone_key].name, null)
}
}
}