Skip to content

Commit 8053496

Browse files
updated files
1 parent 85b2a73 commit 8053496

File tree

1 file changed

+14
-38
lines changed

1 file changed

+14
-38
lines changed

outputs.tf

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -89,49 +89,25 @@ output "subnet_route_associations" {
8989
value = module.network.subnet_route_associations
9090
}
9191

92-
# --- Private DNS Zone outputs (IDs only) -------------------------------------
93-
94-
# Map: zone_name => zone_id (merged from both DNS zone sources)
92+
# Map of DNS Zone IDs keyed by zone name
9593
output "private_dns_zone_ids_by_name" {
96-
description = "Private DNS Zone IDs keyed by zone name (merged from private_dns_zones and monitor_private_link_scope_dns_zone)."
97-
value = merge(
98-
{ for name, m in module.private_dns_zones :
99-
name => try(m.id, m.zone_id, null)
100-
if try(m.id, m.zone_id, null) != null
101-
},
102-
{ for name, m in module.monitor_private_link_scope_dns_zone :
103-
name => try(m.id, m.zone_id, null)
104-
if try(m.id, m.zone_id, null) != null
105-
}
106-
)
94+
description = "Private DNS Zone IDs keyed by zone name"
95+
value = { for k, v in module.private_dns_zones : k => v.id }
10796
}
10897

109-
# Set of all zone IDs (unordered), useful for passing to other modules
98+
# Set of all DNS Zone IDs
11099
output "private_dns_zone_ids" {
111-
description = "All Private DNS Zone IDs as a set (merged)."
112-
value = toset(compact(concat(
113-
[for _, m in module.private_dns_zones : try(m.id, m.zone_id, null)],
114-
[for _, m in module.monitor_private_link_scope_dns_zone : try(m.id, m.zone_id, null)]
115-
)))
100+
description = "Set of all Private DNS Zone IDs"
101+
value = toset([for _, v in module.private_dns_zones : v.id])
116102
}
117103

118-
# Convenience: when there is exactly one zone in module.private_dns_zones,
119-
# this returns that single ID. (Errors if not exactly one.)
120-
output "single_private_dns_zone_id" {
121-
description = "ID when exactly one zone is created via module.private_dns_zones."
122-
value = one([for _, m in module.private_dns_zones : try(m.id, m.zone_id)])
123-
}
124104

125-
# Optional: if you have a single-instance module "private_dns_zone" anywhere,
126-
# this safely exposes its ID without breaking when it's not present.
127-
# (If you don't have such a module, you can delete this block.)
128-
output "private_dns_zone_id" {
129-
description = "ID of a single private DNS zone module instance (if you use one)."
130-
value = try(module.private_dns_zone.id, module.private_dns_zone.zone_id, null)
131-
}
132-
133-
output "postgres_private_dns_zone_id" {
134-
description = "The ID of the Postgres private DNS zone."
135-
value = var.private_dns_zone_enabled ? azurerm_private_dns_zone.postgres[0].id : null
136-
}
105+
# output "zone_name" {
106+
# description = "Name of the private hosted zone."
107+
# value = azurerm_private_dns_zone.private_zone.name
108+
# }
137109

110+
# output "id" {
111+
# description = "ID of the private DNS Zone"
112+
# value = azurerm_private_dns_zone.private_zone.id
113+
# }

0 commit comments

Comments
 (0)