Repository navigation
Description
What is wrong
deployRoute53HostedZone (emulator/cfn_deployer.go:3851-3856) records the hosted zone's physical ID
as the raw Id member of the CreateHostedZone response:
dr.ARN = extractXMLField(resp.Body, "Id")
dr.PhysicalID = dr.ARNRoute 53's CreateHostedZone answers that member in the path form — /hostedzone/Z23ABC4XYZL05B —
and AWS::Route53::HostedZone is not in cfnRefValue's ARN arm, so Ref resolves to that prefixed
string. AWS publishes the opposite:
When you pass the logical ID of this resource to the intrinsic
Reffunction,Refreturns the
hosted zone ID, such asZ23ABC4XYZL05B.
So a record set that names its zone the way AWS's own examples do —
"HostedZoneId": {"Ref": "MyZone"} — builds
POST /2013-04-01/hostedzone//hostedzone/Z6FF97E5B413C/rrset
and is refused with InvalidAction: The action ... is not valid for this endpoint. The /hostedzone/
segment appears twice: once from deployRoute53RecordSet's own path and once from the Ref.
Two further consequences of the same two lines:
dr.ARNis not an ARN. It is set to the same/hostedzone/Z…string. A hosted zone's ARN is
arn:aws:route53:::hostedzone/Z23ABC4XYZL05B, soDescribeStackResourcesreports a resource whose
ARN is a path.Fn::GetAtt Idis published by the same page ("The ID that Amazon Route 53 assigned to the
hosted zone when you created it") and resolves from the same physical ID, so it carries the prefix
too.
And the failure is invisible
deployRoute53RecordSetGroup (emulator/cfn_deployer.go:3903-3916) calls
deployRoute53RecordSet per element and keeps only the Go error:
_, cost, err := d.deployRoute53RecordSet(ctx, childID, rsProps, streamID, cctx)
if err != nil { return DeployedResource{}, totalCost, ... }deployRoute53RecordSet never returns a Go error — a refusal goes into the child's
DeployedResource.Error, which is discarded here. So a RecordSetGroup whose every record set was
refused reports a clean resource with a physical ID, which is #1192's class ("a failure no caller can
see") reached through a different route.
How it was found
A sweep for #1123: every test that calls StackDeployer.Deploy was run alone against an instrumented
cfnFailedResources, and TestCFN_Route53RecordSetGroup (emulator/v016_extra_test.go:592) turned
out to deploy a record set that fails. The test asserts only require.NoError(t, err) and
assert.Len(t, result.Resources, 3), neither of which a failed resource disturbs — which is why the
divergence has been green.
Acceptance criteria
-
RefonAWS::Route53::HostedZoneanswers the bare hosted zone ID, as the page publishes it. -
Fn::GetAtt Idanswers the same bare ID. - The deployed resource's
ARNisarn:aws:route53:::hostedzone/<id>, or is left empty if the
creating operation yields no ARN — not a path masquerading as one. - A
RecordSetnaming its zone by{"Ref": "MyZone"}deploys cleanly, asserted per resource with
an emptyDeployedResource.Error. -
deployRoute53RecordSetGroupreports a child record set's refusal on the group's own
DeployedResource.Errorrather than discarding it, and a test asserts it. - Whether the Route 53 plugin itself should accept the prefixed form on
ChangeResourceRecordSets
(real Route 53 accepts bothZ…and/hostedzone/Z…as a zone ID in the SDK) is decided either
way and recorded — that is a separate question from whatRefanswers.
Provenance
Ref's return value and the Id/NameServers attributes verified 2026-09-20 against
https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-route53-hostedzone.html
The /hostedzone/Z… form of the Id member comes from
https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html — substrate's value
is the API's, and the defect is that it is published as the CloudFormation Ref unchanged.
Activity
scttfrdmn commentedon Sep 20, 2026
#1123 (PR #1257) does not change any of this, but it stops the divergence being invisible:
TestCFN_Route53RecordSetGroup(emulator/v016_extra_test.go) now asserts today's behaviourper resource rather than only
require.NoErrorandassert.Len(…, 3)—MyZone.PhysicalIDmatches^/hostedzone/Z[0-9A-Z]+$andMyZone.ARNequals it,MyRecordSet.ErrorcontainsInvalidActionand the doubled/hostedzone//hostedzone/segment,so the assertion pins the cause and not merely a refusal,
MyRecordSetGroup.Erroris empty although its child was refused identically, which is thediscarded-refusal half,
ROLLBACK_FAILED.Each assertion carries the value this issue is expected to change, and the test has a
TODO(#1256). So fixing this turns that test red with a message naming what moved, rather thanleaving it green in either state.
fix(#1123): a deployed resource that failed is not a deployed resource (
chore(release): v0.124.0 (#1415)