Skip to content

Commit ddb5a77

Browse files
updated files
1 parent a31a21f commit ddb5a77

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

outputs.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,22 @@ output "route_tables_map" {
8787

8888
output "subnet_route_associations" {
8989
value = module.network.subnet_route_associations
90+
}
91+
92+
output "selected_private_dns_zone_id" {
93+
description = "ID of the selected Private DNS Zone (or null if not found)."
94+
value = var.target_private_dns_zone_name == null ? null : lookup(
95+
merge(
96+
{ for name, m in module.private_dns_zones :
97+
name => try(m.id, m.zone_id, null)
98+
if try(m.id, m.zone_id, null) != null
99+
},
100+
{ for name, m in module.monitor_private_link_scope_dns_zone :
101+
name => try(m.id, m.zone_id, null)
102+
if try(m.id, m.zone_id, null) != null
103+
}
104+
),
105+
var.target_private_dns_zone_name,
106+
null
107+
)
90108
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,10 @@ variable "logical_product_service" {
293293
condition = can(regex("^[_\\-A-Za-z0-9]+$", var.logical_product_service))
294294
error_message = "The variable must contain letters, numbers, -, _, and .."
295295
}
296+
}
297+
298+
variable "target_private_dns_zone_name" {
299+
type = string
300+
default = null
301+
description = "If set, outputs the ID for just this zone name from private_dns_zone_ids_by_name."
296302
}

0 commit comments

Comments
 (0)