-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdns_snucse-org.tf
77 lines (66 loc) · 1.63 KB
/
dns_snucse-org.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
locals {
dns_snucse-org = [
# github site verification
{
name = "_github-pages-challenge-bacchus-snu"
type = "TXT"
content = "7b9f5a46f00083087748e0dec86020"
},
# gh pages
{
name = "gpu"
type = "CNAME"
content = "bacchus-snu.github.io"
},
{
name = "sgs-docs"
type = "CNAME"
content = "bacchus-snu.github.io"
},
# GPU image registries
{
name = "registry.ferrari"
type = "CNAME"
content = "ferrari.snucse.org"
},
# sommelier cluster
{
name = "sommelier"
type = "CNAME"
content = "kerkoporta.snucse.org"
},
# apex CNAME, gets flattened by Cloudflare
{
name = "@"
type = "CNAME"
content = "web_gateway.bacchus.io"
},
]
}
resource "cloudflare_zone" "snucse" {
account_id = "9d0fe600126436ae84ee3f9ed2f60a9c"
zone = "snucse.org"
}
resource "cloudflare_record" "snucse_records" {
for_each = { for r in local.dns_snucse-org : "${r.name}_${r.type}" => r }
zone_id = cloudflare_zone.snucse.id
comment = "managed by Terraform"
name = each.value.name
type = each.value.type
content = each.value.content
}
# bacchus.snucse.org cannot be CNAME due to other RRTYPEs (e.g., MX) on the same name.
resource "cloudflare_record" "snucse_bacchus" {
for_each = toset([
# bacchus-snu.github.io.
"185.199.108.153",
"185.199.109.153",
"185.199.110.153",
"185.199.111.153",
])
zone_id = cloudflare_zone.snucse.id
comment = "managed by Terraform"
name = "bacchus"
type = "A"
content = each.value
}