diff --git a/.github/dns-handover.json b/.github/dns-handover.json index fffae63..24c9a43 100644 --- a/.github/dns-handover.json +++ b/.github/dns-handover.json @@ -1,6 +1,3 @@ { - "externalDnsHandover": [ - { "type": "A", "name": "www.devantler.tech" }, - { "type": "AAAA", "name": "www.devantler.tech" } - ] + "externalDnsHandover": [] } diff --git a/dns.tf b/dns.tf index 17172fb..097f9c6 100644 --- a/dns.tf +++ b/dns.tf @@ -28,31 +28,10 @@ resource "cloudflare_dns_record" "apex" { } # external-dns serves www from the business site's public route. It took over -# the old www CNAME through a one-time ownership record (forgotten below) and -# replaced it with the gateway addresses. Its own ownership records for those -# addresses then disappeared, so these two restore them with external-dns's -# exact content. external-dns re-owns the existing www records without -# changing them. .github/dns-handover.json lists the two records they claim. -resource "cloudflare_dns_record" "www_external_dns_owner_a" { - zone_id = cloudflare_zone.primary.id - name = "_externaldns.a-www.devantler.tech" - type = "TXT" - content = "\"heritage=external-dns,external-dns/owner=platform.devantler.tech,external-dns/resource=httproute/business-site/business-site-public\"" - ttl = 1 - proxied = false - settings = {} -} - -resource "cloudflare_dns_record" "www_external_dns_owner_aaaa" { - zone_id = cloudflare_zone.primary.id - name = "_externaldns.aaaa-www.devantler.tech" - type = "TXT" - content = "\"heritage=external-dns,external-dns/owner=platform.devantler.tech,external-dns/resource=httproute/business-site/business-site-public\"" - ttl = 1 - proxied = false - settings = {} -} - +# the old www CNAME through a one-time ownership record (forgotten below), +# replaced it with the gateway addresses and owns them through its own +# `_externaldns.a-www` and `_externaldns.aaaa-www` records. This repository +# manages none of them. removed { from = cloudflare_dns_record.www_external_dns_owner diff --git a/scripts/tests/test-dns-apply.sh b/scripts/tests/test-dns-apply.sh index 7f03395..8ffb6fb 100755 --- a/scripts/tests/test-dns-apply.sh +++ b/scripts/tests/test-dns-apply.sh @@ -156,10 +156,9 @@ for list in '{"externalDnsHandover":[{"type":"a","name":"www.devantler.tech"}]}' printf '%s\n' "$list" > "$scratch/handover.json" { printf '%s\n' "$noop_import"; marker _externaldns.a-www.devantler.tech; } | reject "invalid handover list $list" done -# The repository's own list is valid and admits exactly the www handover it was written for. +# The repository's own list is valid, so a typo in it cannot stop every DNS run. cp "$root/.github/dns-handover.json" "$scratch/handover.json" -{ printf '%s\n' "$noop_import"; marker _externaldns.a-www.devantler.tech - change cloudflare_dns_record.marker_aaaa cloudflare_dns_record '["create"]' null '{"name":"_externaldns.aaaa-www.devantler.tech","type":"TXT","content":"x"}' null; } | plan | check +printf '%s\n' "$noop_import" | plan | check printf '%s\n' '{"externalDnsHandover":[]}' > "$scratch/handover.json" # A record external-dns owns is never written here, and every write has a known # name (OpenTofu writes an unknown value as null).