-
Notifications
You must be signed in to change notification settings - Fork 0
/
records.tf
92 lines (75 loc) · 3.14 KB
/
records.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
resource "azurerm_private_dns_a_record" "this" {
for_each = { for record in try(var.records.a, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
records = each.value.records
ttl = try(each.value.ttl, 300)
}
resource "azurerm_private_dns_aaaa_record" "this" {
for_each = { for record in try(var.records.aaaa, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
records = each.value.records
ttl = try(each.value.ttl, 300)
}
resource "azurerm_private_dns_cname_record" "this" {
for_each = { for record in try(var.records.cname, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
record = each.value.record
ttl = try(each.value.ttl, 300)
}
resource "azurerm_private_dns_mx_record" "this" {
for_each = { for record in try(var.records.mx, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
ttl = try(each.value.ttl, 300)
dynamic "record" {
for_each = each.value.record
content {
preference = record.value.preference
exchange = record.value.exchange
}
}
}
resource "azurerm_private_dns_ptr_record" "this" {
for_each = { for record in try(var.records.ptr, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
records = each.value.records
ttl = try(each.value.ttl, 300)
}
resource "azurerm_private_dns_srv_record" "this" {
for_each = { for record in try(var.records.srv, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
ttl = try(each.value.ttl, 300)
dynamic "record" {
for_each = each.value.record
content {
priority = record.value.priority
weight = record.value.weight
port = record.value.port
target = record.value.target
}
}
}
resource "azurerm_private_dns_txt_record" "this" {
for_each = { for record in try(var.records.txt, []) : record.name => record }
resource_group_name = azurerm_private_dns_zone.this.resource_group_name
zone_name = azurerm_private_dns_zone.this.name
name = lower(each.value.name)
ttl = try(each.value.ttl, 300)
dynamic "record" {
for_each = each.value.record
content {
value = record.value
}
}
}