-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
40 lines (35 loc) · 1.01 KB
/
main.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
32
33
34
35
36
37
38
39
40
resource "azurerm_resource_group" "this" {
name = var.resource_group.name
location = var.location
tags = merge(
var.tags,
tomap({
"Resource Type" = "Resource Group"
})
)
}
resource "azurerm_private_dns_zone" "this" {
for_each = local.private_dns_zones
name = each.key
resource_group_name = azurerm_resource_group.this.name
tags = merge(
var.tags,
tomap({
"Resource_Type" = "Private DNS Zone"
})
)
}
resource "azurerm_private_dns_zone_virtual_network_link" "this" {
for_each = var.virtual_network_id != null ? local.private_dns_zones : {}
name = "${each.key}-vnet-link"
resource_group_name = azurerm_resource_group.this.name
private_dns_zone_name = azurerm_private_dns_zone.this[each.key].name
virtual_network_id = var.virtual_network_id
depends_on = [azurerm_private_dns_zone.this]
tags = merge(
var.tags,
tomap({
"Resource_Type" = "Private DNS Zone Virtual Network Link"
})
)
}