Skip to content

feat(#1613, #1586): Route 53 GetChange, health checks, tags, ListHostedZonesByName; batch-atomic change validation - #1705

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/v0134-route53
Nov 25, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/v0134-route53

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1586
Part of #1613: this is the Route 53 slice. STS/IAM federation, Lambda versions and EventBridge remain, in their own workstreams.

  • GetChange. Every ChangeInfo minted by CreateHostedZone, DeleteHostedZone and ChangeResourceRecordSets is stored as change:<id> with its SubmittedAt and Comment. A seeded PENDING→INSYNC progression (route53_change_progression.go, on progression.go) is set through POST/DELETE /v1/route53/change-status, keyed by change ID (with or without /change/) or *, and is in the recorded control-plane group. The minting responses peek and GetChange observes. Unseeded, a change is INSYNC. An unknown change is NoSuchChange/404.
  • ListHostedZonesByName and UpdateHostedZoneComment. Zones are sorted by reversed labels, then by ID. Paging uses dnsname/hostedzoneid/maxitems, with NextDNSName/NextHostedZoneId. A bad dnsname is InvalidDomainName/400, and hostedzoneid without dnsname is InvalidInput/400.
  • Tags. ChangeTagsForResource, ListTagsForResource and ListTagsForResources cover hosted zones and health checks, with at most 10 tags per resource (per API_ChangeTagsForResource). Tags live on the resource record. The Resource Groups Tagging API has no Route 53 scan, so the two views cannot disagree.
  • Health checks.
    • Create, Get, List (paged by marker), Update, Delete and GetHealthCheckCount.
    • CallerReference is idempotent against the settings the create was sent with, which the caller-reference record stores. Different settings, or a deleted check's reference, are HealthCheckAlreadyExists/409. A live reference whose check is gone creates one.
    • HealthCheckVersion increments on each update, and a mismatch is HealthCheckVersionMismatch/409. An unknown ID is NoSuchHealthCheck/404. TooManyHealthChecks applies past 200.
    • GetHealthCheckStatus comes from the POST/DELETE /v1/route53/health-check-status seed and is never computed. A CALCULATED check is InvalidInput.
  • Record identity.
    • Record sets are keyed by (normalized name, type, SetIdentifier). Names are normalized per the Developer Guide's "DNS domain name format": lower-cased, with octal escapes, so *.example.com and \052.example.com are one record set. ListResourceRecordSets reports names in that form with a trailing dot, which is also what Terraform's provider normalizes to (internal/dns.Normalize).
    • A record stored without routing members is found by a DELETE, CREATE or UPSERT that names a SetIdentifier. A CREATE of it is refused, and an UPSERT moves it to the identity's key.
  • route53: ChangeResourceRecordSets applies a CREATE of an existing record set and a DELETE of a missing one #1586. A batch is validated whole, in order, against the record sets it names; only those identities are read. CREATE of an existing record set, DELETE of a missing one, DELETE with mismatched values and a double DELETE all fail the batch with InvalidChangeBatch in AWS's bracketed wording (sources cited). This check runs before the apex check, so a CREATE of the existing apex SOA or NS says "already exists". An unreadable TTL/Weight is InvalidInput; see the comment on route53: ChangeResourceRecordSets applies a CREATE of an existing record set and a DELETE of a missing one #1586.
  • Zone writes (create, delete, batch, comment, tags) hold p.mu, and a race test covers them.
  • CloudFormation.
    • Record sets deploy their SetIdentifier/Weight/Region/Failover/HealthCheckId. The stack delete finds the record set by that identity, sends its stored values, and treats a miss as already gone.
    • AWS::Route53::HealthCheck sends a per-attempt CallerReference: a hash of the stack ARN and logical ID, plus a mint draw.
    • NoSuchHealthCheck is in cfnDeleteAbsentCodes.
  • Validation. Route 53 has no op filter, so all 13 new ops are gate-validated. The rules comment in wire_validate_errors.go lists them.

Routed operations go from 1,171 to 1,184 (route53: 6 to 19), on top of #1704, #1703 and #1701.

Gates run locally after rebasing on 0073e2a:

  • make lint test e2e;
  • both drift sets and docs-versions/docs-counts-check.

SUBSTRATE_IAC=1 make iac-e2e (Terraform and CDK) also passed on 0073e2a. The VitePress build passed on f5db4ea.

Terraform scratch check used provider 6.73.0 from the plugin cache. The config had a tagged mixed-case zone (Scratch.Example.com), an A record, a *. wildcard record, an alias record targeting WWW.scratch.example.com, two weighted records (one with a health check) and an HTTPS health check. Apply added 7, a second plan was empty (exit 0), and destroy removed 7, leaving the state empty.

The first run of that config found one more bug, which this PR fixes. ListResourceRecordSets rendered an empty <ResourceRecords/> for alias records, so Terraform's destroy sent the empty element back and validation refused it. Alias record sets now carry no ResourceRecords element.

Follow-ups, not filed yet:

  • ListResourceRecordSets sort order and name/type/maxitems paging.
  • A Tagging API provider for Route 53.
  • The CNAME-conflict and routing-policy-mixing rules.
  • HealthCheckInUse.

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

scttfrdmn added a commit that referenced this pull request Nov 25, 2026
…edZonesByName; batch-atomic change validation

GetChange reports every minted change with a seeded PENDING window; health
checks with idempotent CallerReference, versions and seeded status; tag
operations; ListHostedZonesByName and UpdateHostedZoneComment. Change batches
are validated whole against the record sets they name, record sets are keyed
by normalized name, type and SetIdentifier, and the CloudFormation record-set
delete sends the stored values. Includes the #1705 review fixes.

Co-Authored-By: Claude <[email protected]>
…edZonesByName; batch-atomic change validation

GetChange reports every minted change with a seeded PENDING window; health
checks with idempotent CallerReference, versions and seeded status; tag
operations; ListHostedZonesByName and UpdateHostedZoneComment. Change batches
are validated whole against the record sets they name, record sets are keyed
by normalized name, type and SetIdentifier, names are reported in Route 53's
normalized form, and the CloudFormation record-set delete sends the stored
values. Includes both #1705 review rounds.

Co-Authored-By: Claude <[email protected]>
@scttfrdmn
scttfrdmn merged commit c3382f0 into main Nov 25, 2026
20 checks passed
@scttfrdmn
scttfrdmn deleted the feat/v0134-route53 branch November 25, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

route53: ChangeResourceRecordSets applies a CREATE of an existing record set and a DELETE of a missing one

1 participant