2024-08-02 20:10:21 +00:00
|
|
|
|
|
|
|
locals {
|
2024-08-04 17:50:50 +00:00
|
|
|
locations = {
|
|
|
|
DE = ["46.4.88.62", "2a01:4f8:202:2395::"]
|
|
|
|
SI = ["93.103.125.118", "2a01:261:455:6c00:21e:6ff:fe45:c34"]
|
2024-08-02 20:10:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
data "digitalocean_domain" "ingress" {
|
|
|
|
name = "ingress.tjo.cloud"
|
|
|
|
}
|
|
|
|
|
2024-08-04 17:50:50 +00:00
|
|
|
resource "digitalocean_record" "locations" {
|
|
|
|
for_each = merge([
|
|
|
|
for location, ips in local.locations : {
|
|
|
|
for ip in ips : "${location} at ${ip}" => {
|
|
|
|
location = location,
|
|
|
|
ip = ip,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]...)
|
2024-08-02 20:10:21 +00:00
|
|
|
|
|
|
|
domain = data.digitalocean_domain.ingress.id
|
2024-08-04 17:50:50 +00:00
|
|
|
type = strcontains(each.value.ip, ":") ? "AAAA" : "A"
|
|
|
|
name = lower(each.value.location)
|
|
|
|
value = each.value.ip
|
|
|
|
ttl = 60
|
2024-08-02 20:10:21 +00:00
|
|
|
}
|