@@ -89,49 +89,25 @@ output "subnet_route_associations" {
89
89
value = module. network . subnet_route_associations
90
90
}
91
91
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
95
93
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 }
107
96
}
108
97
109
- # Set of all zone IDs (unordered), useful for passing to other modules
98
+ # Set of all DNS Zone IDs
110
99
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 ])
116
102
}
117
103
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
- }
124
104
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
+ # }
137
109
110
+ # output "id" {
111
+ # description = "ID of the private DNS Zone"
112
+ # value = azurerm_private_dns_zone.private_zone.id
113
+ # }
0 commit comments