-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route53 ZoneDelegationRecord doesn't accept PublicHostedZone hostedZoneNameServers #1847
Comments
Could you give more details on this? Because it sure seems like that should work. |
@skorfmann as mentioned in the documentation the In your particular case, you can assert the name servers are present by simply adding an exclamation mark: const zoneDelegation = new route53.ZoneDelegationRecord(this, 'PreviewZoneDelegation', {
zone: mainZone,
delegatedZoneName: previewZone.zoneName,
nameServers: previewZone.hostedZoneNameServers! // <-- the "!" means "I know this won't be undefined"
}); Also - note that I changed the |
I've tested this and it appears there is a bug related to how the tokens are handled here, which causes the code to crash with an obscure error. I am preparing a fix for this. |
When creating delegation relationship between two `PublicHostedZone`s, one can now use `zone.delegateTo(otherZone)` instead of manually creating the `ZoneDelegationRecord` insteance. This reduces the risk of passing the incorrect name server, or hosting the record on the wrong end of the relationship (DNS is hard!) Additionally, fixes a bug in which it was not possible to create a zone delegation record using a `IHostedZone.hostedZoneNameServers` property as the array was mapped, which caused the `Fn::GetAtt` stringified list token to become corrupted. Fixes #1847
#1853 includes a fix for the bug in question, and also introduces an API such that you could: mainZone.delegateTo(previewZone); |
Sweet, didn't know that.
Awesome, thank you! |
When creating delegation relationship between two `PublicHostedZone`s, one can now use `zone.addDelegation(otherZone)` instead of manually creating the `ZoneDelegationRecord` insteance. This reduces the risk of passing the incorrect name server, or hosting the record on the wrong end of the relationship (DNS is hard!) Additionally, fixes a bug in which it was not possible to create a zone delegation record using a `IHostedZone.hostedZoneNameServers` property as the array was mapped, which caused the `Fn::GetAtt` stringified list token to become corrupted. Fixes #1847
Given I have two zones, where I want to delegate from one zone to the other, I can't use the L2 Route53 ZoneDelegationRecord.
So, this issue appears to be, that
hostedZoneNameServers
returnsnull | string[]
rather than juststring[]
. I tried this:While this satisfies the type, it fails when actually running it via the CDK.
What I ended up doing for now:
The text was updated successfully, but these errors were encountered: