-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
CrossAccountZoneDelegationRecord: Validation fails for public and private hosted zone with the same name #30262
Comments
@ENM185 Good afternoon. Thanks for reporting the issue. Could you please share the following:
I came across useful article https://stackoverflow.com/questions/66616710/how-can-i-set-up-my-hostedzone-so-that-it-delegates-to-a-parent-dns-record-in-an but it would be good to reproduce the issue end-to-end based on your sample code. Thanks, |
I don't think it's useful to provide a CDK example as this is a cross-account issue. To reproduce, create two hosted zones with the same name in one account, one public and one private. Then use the |
Reproducible with the following steps:
|
…ith same name (#30439) ### Issue # (if applicable) Closes #30262. ### Reason for this change Route53 does not support subdomain delegation on Private Hosted Zones ([source](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-private-considerations.html#hosted-zone-private-considerations-delegating-subdomain)). `CrossAccountZoneDelegationRecord` should ignore Private Hosted Zones instead of throwing error. ### Description of changes In `CrossAccountZoneDelegationRecord` handler, filter out Private Hosted Zones. ### Description of how you validated changes Deployed a stack that uses the updated `CrossAccountZoneDelegationRecord` handler where the parent account has both public and private hosted zones with the same domain name. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ith same name (aws#30439) ### Issue # (if applicable) Closes aws#30262. ### Reason for this change Route53 does not support subdomain delegation on Private Hosted Zones ([source](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-private-considerations.html#hosted-zone-private-considerations-delegating-subdomain)). `CrossAccountZoneDelegationRecord` should ignore Private Hosted Zones instead of throwing error. ### Description of changes In `CrossAccountZoneDelegationRecord` handler, filter out Private Hosted Zones. ### Description of how you validated changes Deployed a stack that uses the updated `CrossAccountZoneDelegationRecord` handler where the parent account has both public and private hosted zones with the same domain name. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
CrossAccountZoneDelegationRecord complains about more than 1 matching zone when only one of them is public.
Expected Behavior
Validate that there is only one public hosted zone matching the name.
Current Behavior
Validates that there is only one (no filter by public) hosted zone matching the name. The logic is here:
aws-cdk/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts
Line 79 in 623cedb
Reproduction Steps
Create a public and private hosted zone in one account with the same name and then a CrossAccountZoneDelegationRecord in the other.
Possible Solution
Filter by public hosted zone here:
aws-cdk/packages/@aws-cdk/custom-resource-handlers/lib/aws-route53/cross-account-zone-delegation-handler/index.ts
Line 79 in 623cedb
Additional Information/Context
No response
CDK CLI Version
2.136.0
Framework Version
No response
Node.js Version
8.19.4
OS
Linux
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: