fix(route53): preserve negative answers through private CNAME chains (#7460)

Preserve the target's negative DNS answer while chasing a private CNAME. Cover missing and TXT-only targets, creation/deletion, and positive TTLs.

Signed-off-by: Andre Kurait <akurait@amazon.com>

(cherry picked from commit da2e197f93113312212d502ee303e94ac4aa87c7)

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Jackson PriceandAndre Kurait authored and GitHub committed 2026-11-03 21:33:10 -04:00
1 parent 9158f28b01
commit a796e2e58f
3 files changed
+43 -1

No files matched your search

@@ -229,6 +229,9 @@ public class Route53DnsRecordSource implements DnsRecordSource {
int cnameTtl = ttlOf(rrs);
if (route53Service.isCoveredByPrivateZone(cleanTarget)) {
DnsAnswer targetAnswer = resolveAddresses(cleanTarget, visited, depth + 1);
if (targetAnswer.isEmpty()) {
return targetAnswer;
}
return DnsAnswer.records(targetAnswer.addresses(),
Math.min(cnameTtl, targetAnswer.ttlSeconds()));
}