-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhitestar_systems.tf
176 lines (150 loc) · 4.56 KB
/
whitestar_systems.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
locals {
brickyard_local_ips = {
"broadmoor" : "10.0.10.16",
"laurelhurst" : "10.0.40.2",
"woodlandpark" : "10.0.10.32",
"roosevelt" : "10.0.40.4",
"ravenna" : "10.0.40.3",
"unifi-controller" : "10.0.1.6",
"beaconhill" : "10.0.1.1",
}
k3s_primaries = [
"10.0.40.2",
"10.0.40.3",
"10.0.40.4",
]
ipmi_addresses = {
"ravenna" : "10.0.199.2",
"roosevelt" : "10.0.199.3",
"woodlandpark" : "10.0.199.4",
"beaconhill" : "10.0.199.5",
"laurelhurst" : "10.0.199.6",
}
}
resource "cloudflare_zone" "whitestar_systems" {
account_id = local.cf_account_id
zone = "whitestar.systems"
}
module "whitestar_systems_email" {
source = "./modules/cloudflare_email_routing"
zone_id = cloudflare_zone.whitestar_systems.id
allowed_senders = ["include:amazonses.com"]
}
resource "cloudflare_record" "whitestar_systems_keybase_verification" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "@"
type = "TXT"
content = "keybase-site-verification=ZMKzMIfHqDIUV4SrGSCCRP09C0TSada5zNxdosjudGA"
}
resource "cloudflare_record" "whitestar_systems_github_verification" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "_github-challenge-ws-systems-org"
type = "TXT"
content = "5a889d68b4"
}
resource "cloudflare_record" "whitestar_systems_brickyard_ips" {
for_each = local.brickyard_local_ips
zone_id = cloudflare_zone.whitestar_systems.id
name = "${each.key}.brickyard"
type = "A"
proxied = false
content = each.value
}
resource "cloudflare_record" "whitestar_systems_ipmi_ips" {
for_each = local.ipmi_addresses
zone_id = cloudflare_zone.whitestar_systems.id
name = "${each.key}.brickyard.ipmi"
type = "A"
proxied = false
content = each.value
}
resource "cloudflare_record" "whitestar_brickyard_ubnt" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "ubnt.brickyard"
type = "CNAME"
proxied = false
content = "unifi-controller.brickyard.whitestar.systems"
ttl = "30"
}
resource "cloudflare_record" "dmarc" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "_dmarc"
type = "TXT"
content = "v=DMARC1; p=quarantine; rua=mailto:[email protected]"
}
resource "cloudflare_record" "k3s_primaries" {
for_each = toset(local.k3s_primaries)
zone_id = cloudflare_zone.whitestar_systems.id
name = "k3s.brickyard"
type = "A"
proxied = false
content = each.key
}
resource "cloudflare_record" "k3s_ingress" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "*.ing.k3s.brickyard"
type = "A"
proxied = false
content = "10.30.0.0"
}
resource "cloudflare_record" "k3s_auth_ingress" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "*.auth-ing.k3s.brickyard"
type = "CNAME"
proxied = true
content = "6bd25c6e-9222-43e6-bdb3-f989da6cbdb2.cfargotunnel.com"
}
resource "cloudflare_record" "brickyard_vlmcsd" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "vlmcsd.brickyard"
type = "A"
proxied = false
content = "10.30.0.1"
}
resource "cloudflare_record" "netbox" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "netbox"
type = "CNAME"
proxied = true
content = "netbox.auth-ing.k3s.brickyard.whitestar.systems"
}
resource "cloudflare_record" "grafana-brickyard" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "grafana.brickyard"
type = "CNAME"
proxied = true
content = "grafana.auth-ing.k3s.brickyard.whitestar.systems"
}
resource "cloudflare_record" "n8n-brickyard" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "n8n.brickyard"
type = "CNAME"
proxied = true
content = "n8n.auth-ing.k3s.brickyard.whitestar.systems"
}
resource "cloudflare_record" "auth" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "auth"
type = "CNAME"
proxied = true
content = "zitadel.auth-ing.k3s.brickyard.whitestar.systems"
}
resource "cloudflare_record" "woodlandpark-smb" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "woodlandpark-ssh.access.brickyard"
type = "CNAME"
proxied = true
content = cloudflare_tunnel.brickyard_warp_tunnel.cname
}
resource "cloudflare_record" "protect" {
zone_id = cloudflare_zone.whitestar_systems.id
name = "protect.brickyard"
type = "CNAME"
proxied = true
content = cloudflare_tunnel.brickyard_warp_tunnel.cname
}
resource "cloudflare_argo" "whitestar_systems_argo" {
smart_routing = "on"
zone_id = cloudflare_zone.whitestar_systems.id
}
// TODO Zone Configuration (Like Cache Settings)