From 31966f963497645632873f7c28fbb9cbb34cf6f8 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Sun, 15 Nov 2026 05:53:38 +0100 Subject: [PATCH] fix(dns): leave the restored www ownership records to external-dns external-dns's `_externaldns.a-www` and `_externaldns.aaaa-www` records are back in the zone with its own content, so the plan for #78 refused to create or adopt them (external-dns-owned) and applied nothing. Drop the two record resources and empty the handover list; the apex edit and the forget of the old cname-www marker remain. Part of #21. Co-Authored-By: Claude Opus 5.5 --- .github/dns-handover.json | 5 +---- dns.tf | 29 ++++------------------------- scripts/tests/test-dns-apply.sh | 5 ++--- 3 files changed, 7 insertions(+), 32 deletions(-) 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).