diff --git a/tf-stage1/archlinux.tf b/tf-stage1/archlinux.tf index e336ed0ec66c71b9ea30a6913da3bb9d70ba0c14..41bba840f55d656f83ff30b9a0bb20915552366f 100644 --- a/tf-stage1/archlinux.tf +++ b/tf-stage1/archlinux.tf @@ -366,6 +366,11 @@ locals { } # Domains served by machines in the geo_mirrors group + # Valid parameters are: + # - zone_id (mandatory, either of hetznerdns_zone.{archlinux,pkgbuild}.id) + # - name (mandatory, specifies the subdomain to create in the above zone) + # - ttl (optional, the TTL of the NS records, defaults to 86400 if unset) + # geo_domains = { "geo.mirror.pkgbuild.com" = { zone_id = hetznerdns_zone.pkgbuild.id diff --git a/tf-stage1/templates.tf b/tf-stage1/templates.tf index 24df546277ab610aab1bebb9c3498207f217f6ac..3fa0888acec0cb423dfdb4414d418917bff2e003 100644 --- a/tf-stage1/templates.tf +++ b/tf-stage1/templates.tf @@ -150,7 +150,7 @@ resource "hetznerdns_record" "geo_ns1" { name = each.value.name value = "asia.mirror.pkgbuild.com." type = "NS" - ttl = 86400 + ttl = lookup(local.geo_domains[each.key], "ttl", 86400) } resource "hetznerdns_record" "geo_ns2" { @@ -160,7 +160,7 @@ resource "hetznerdns_record" "geo_ns2" { name = each.value.name value = "america.mirror.pkgbuild.com." type = "NS" - ttl = 86400 + ttl = lookup(local.geo_domains[each.key], "ttl", 86400) } resource "hetznerdns_record" "geo_ns3" { @@ -170,5 +170,5 @@ resource "hetznerdns_record" "geo_ns3" { name = each.value.name value = "europe.mirror.pkgbuild.com." type = "NS" - ttl = 86400 + ttl = lookup(local.geo_domains[each.key], "ttl", 86400) }