-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
85 lines (75 loc) · 2.04 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
locals {
cname_mappings = {
GOOGLE = {
url = "ghs.google.com"
},
GOOGLE_HOSTED = {
url = "ghs.googlehosted.com"
}
}
}
resource "cloudflare_record" "mx" {
zone_id = var.cloudflare_zone_id
name = var.domain_name
value = "aspmx.l.google.com"
type = "MX"
priority = 1
}
resource "cloudflare_record" "mx_alt_1" {
zone_id = var.cloudflare_zone_id
name = var.domain_name
value = "alt1.aspmx.l.google.com"
type = "MX"
priority = 5
}
resource "cloudflare_record" "mx_alt_2" {
zone_id = var.cloudflare_zone_id
name = var.domain_name
value = "alt2.aspmx.l.google.com"
type = "MX"
priority = 5
}
resource "cloudflare_record" "mx_alt_3" {
zone_id = var.cloudflare_zone_id
name = var.domain_name
value = "alt3.aspmx.l.google.com"
type = "MX"
priority = 10
}
resource "cloudflare_record" "mx_alt_4" {
zone_id = var.cloudflare_zone_id
name = var.domain_name
value = "alt4.aspmx.l.google.com"
type = "MX"
priority = 10
}
resource "cloudflare_record" "calendar_cname" {
name = "calendar"
value = lookup(local.cname_mappings[var.service_cname_redirect], "url", null)
type = "CNAME"
zone_id = var.cloudflare_zone_id
}
resource "cloudflare_record" "contacts_cname" {
name = "contacts"
value = lookup(local.cname_mappings[var.service_cname_redirect], "url", null)
type = "CNAME"
zone_id = var.cloudflare_zone_id
}
resource "cloudflare_record" "docs_cname" {
name = "docs"
value = lookup(local.cname_mappings[var.service_cname_redirect], "url", null)
type = "CNAME"
zone_id = var.cloudflare_zone_id
}
resource "cloudflare_record" "mail_cname" {
name = "mail"
value = lookup(local.cname_mappings[var.service_cname_redirect], "url", null)
type = "CNAME"
zone_id = var.cloudflare_zone_id
}
resource "cloudflare_record" "drive_cname" {
name = "drive"
value = lookup(local.cname_mappings[var.service_cname_redirect], "url", null)
type = "CNAME"
zone_id = var.cloudflare_zone_id
}