-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdns.tf
17 lines (16 loc) · 969 Bytes
/
dns.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
resource "azurerm_private_dns_zone" "example" {
for_each = var.create_private_dns_zone == true ? toset(var.dns_zone_name) : toset([])
name = each.key
resource_group_name = local.hub_resource_group_name[0]
tags = var.tags
depends_on = [azurerm_resource_group.rg]
}
resource "azurerm_private_dns_zone_virtual_network_link" "hub-privatelink-dns" {
for_each = var.create_private_dns_zone == true && var.link_dns_network == true ? toset(var.dns_zone_name) : toset([])
name = each.key
resource_group_name = local.hub_resource_group_name[0]
registration_enabled = false # Auto registration_enabled set to false as we cannot add multiple Private DNS to 1 Vnet
private_dns_zone_name = each.key
virtual_network_id = azurerm_virtual_network.vnet["${local.hub_network_name[0]}"].id
depends_on = [azurerm_resource_group.rg, azurerm_private_dns_zone.example]
}