-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
61 lines (51 loc) · 1.43 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
data "cloudflare_zone" "zone" {
name = var.zone
}
resource "cloudflare_record" "txt" {
for_each = local.txt_records_map
zone_id = data.cloudflare_zone.zone.id
type = "TXT"
name = each.value.name
value = each.value.target
ttl = 1 # this means use the Cloudflare default, not literally one second
allow_overwrite = var.allow_overwrite
}
resource "cloudflare_record" "mx" {
for_each = var.mx_records
zone_id = data.cloudflare_zone.zone.id
type = "MX"
name = each.value.name
value = each.value.target
priority = each.value.priority
ttl = 3600
allow_overwrite = var.allow_overwrite
}
resource "cloudflare_record" "ns" {
for_each = local.ns_records_map
zone_id = data.cloudflare_zone.zone.id
type = "NS"
name = each.value.name
value = each.value.target
ttl = 3600
allow_overwrite = var.allow_overwrite
}
resource "cloudflare_record" "cname" {
for_each = local.cname_records_map
zone_id = data.cloudflare_zone.zone.id
type = "CNAME"
name = each.value.name
value = each.value.target
proxied = each.value.proxied
ttl = 1
allow_overwrite = var.allow_overwrite
}
resource "cloudflare_record" "a" {
for_each = local.a_records_map
zone_id = data.cloudflare_zone.zone.id
type = "A"
name = each.value.name
value = each.value.target
proxied = each.value.proxied
ttl = 1
allow_overwrite = var.allow_overwrite
}