-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudflare.tf
177 lines (168 loc) · 3.81 KB
/
cloudflare.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
provider "cloudflare" {
api_token = var.cloudflare_api_token
}
locals {
a_record_type = "A"
cname_record_type = "CNAME"
xquare_design_record_name = "design"
xquare_mysql_record_name = "mysql"
xquare_redis_record_name = "redis"
xquare_server_record_names = [
# DOMAIN_NAME
"symbols-client",
"symbols",
"otel-trace-reciever",
"turborepo-remote-cache",
"admin",
"admin",
"admin",
"apply",
"auth",
"demo",
"entrydsm",
"maeumgagym-docs",
"auth",
"entry-admission-admin-stag",
"entry-admin-admission-stag",
"entry-admission-stag",
"equus",
"photohub-stag",
"photohub-stag",
"photohub-backend-stag",
"equus-feed-stag",
"equus-stag",
"propofol",
"entry-auth-stag",
"entry-auth",
"entry-lts",
"entry-lts-stag",
"admin",
"api-chitchat",
"argo-cd",
"aster",
"cloud-config",
"daedongyeojido-fe",
"daedongyeojido_fe",
"daedongyeojido",
"dev-api.ddms-dsm.com",
"dev-dms",
"devlib",
"dex-login",
"dex",
"dms",
"dutyful-stag",
"grafana",
"infisical",
"jaeger",
"keycloak",
"kht",
"kiali",
"kube-cost",
"loki",
"maeumgagym-admin-stag",
"maeumgagym-hook",
"maeumgagym-main-stag",
"maeumgagym-user-stag",
"maeumgagym",
"merge-backend",
"merge-user",
"oidc-proxy",
"pick-admin-stag",
"pick-admin",
"pick-stag",
"pick-teacher-stag",
"pick-teacher",
"prod-server",
"project",
"prometheus",
"scul",
"service",
"singtory-api",
"stag-server",
"thanos-store",
"thanos",
"tsdata.aliens-dms.com",
"tsdata",
"vault",
"grafana-tempo",
"gocd",
"equus-stag-kafka"
]
pick_server_record_names = [
"admin",
"teacher",
]
repo_on_premise_record_names = [
"admin",
"mariadb",
"mongodb",
"server",
]
repo_server_record_names = [
"api",
"teacher",
"test",
"user",
"www",
]
}
resource "cloudflare_record" "xquare_server_record" {
for_each = toset(local.xquare_server_record_names)
name = each.value
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_server_domain
zone_id = var.xquare_cloudflare_zone_id
}
resource "cloudflare_record" "pick_server_record" {
for_each = toset(local.pick_server_record_names)
name = each.value
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_server_domain
zone_id = var.pick_cloudflare_zone_id
}
resource "cloudflare_record" "repo_server_record" {
for_each = toset(local.repo_server_record_names)
name = each.value
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_server_domain
zone_id = var.repo_cloudflare_zone_id
}
resource "cloudflare_record" "repo_on_premise_record" {
for_each = toset(local.repo_on_premise_record_names)
name = each.value
proxied = false
ttl = 1
type = local.a_record_type
value = var.repo_on_premise_ip
zone_id = var.repo_cloudflare_zone_id
}
resource "cloudflare_record" "xquare_design_record" {
name = local.xquare_design_record_name
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_design_domain
zone_id = var.xquare_cloudflare_zone_id
}
resource "cloudflare_record" "xquare_mysql_record" {
name = local.xquare_mysql_record_name
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_mysql_domain
zone_id = var.xquare_cloudflare_zone_id
}
resource "cloudflare_record" "xquare_redis_record" {
name = local.xquare_redis_record_name
proxied = false
ttl = 1
type = local.cname_record_type
value = var.xquare_redis_domain
zone_id = var.xquare_cloudflare_zone_id
}