(Route53): Cannot call addDelegation on hosted zones assembled from attributes #28245
Labels
@aws-cdk/aws-route53
Related to Amazon Route 53
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
A public hosted zone, assembled from attributes implements
IHostedZone
, which has theaddDelegation
method. This method requires the knowledge ofhostedZoneNameServers
, which I believe is not available when assembling from attributes.Expected Behavior
One of:
addDelegation
method.addDelegation
method should correctly check forhostedZoneNameServers
and throw a meaningful error.Current Behavior
An ambigous and user-hostile (due to the lack of source maps) error is thrown:
Reproduction Steps
Possible Solution
aws-cdk/packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts
Lines 363 to 372 in 03a5ecd
delegate.hostedZoneNameServers! <---
), this is already a code smell.assert(delegate.hostedZoneNameServers, 'No name servers')
Additional Information/Context
N/A
CDK CLI Version
2.111.0
Framework Version
2.100.0
Node.js Version
v18.12.1
OS
macOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: