Skip to content
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

aws-cdk: Exporting/importing HostedZoneIds across CDK apps #30384

Closed
1 of 2 tasks
girotomas opened this issue May 30, 2024 · 3 comments
Closed
1 of 2 tasks

aws-cdk: Exporting/importing HostedZoneIds across CDK apps #30384

girotomas opened this issue May 30, 2024 · 3 comments
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@girotomas
Copy link

girotomas commented May 30, 2024

Describe the feature

Hello,

We have one CDK app that deploys a Hosted Zone and another CDK app that uses that Hosted Zone. Both are deployed in the same account.

Until now we've been using: HostedZone.fromLookup()

The issue with HostedZone.fromLookup() is that it "hardcodes" the hosted zone id in cdk.context.json. This is not good for region build automation and we want to move away from having to create a code change every time we add a new region and it's hosted zones.

HostedZone.fromAttributes requires the HostedZoneId which is the same problem.

Can we export the Hosted ZoneId in one cdk app and import it from another?

Thanks

More Details on what is currently supported in the CDK

As you can see here: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53.HostedZone.html#static-fromwbrhostedwbrzonewbrattributesscope-id-attrs

There are currently 3 ways to import a hosted zone from another cdk app. Each one of them has issues:

  • fromHostedZoneAttributes -> Requires HostedZone Id to be available at build time
  • fromHostedZoneId -> Requires HostedZone Id to be available at build time
  • fromLookup -> Requires that we specify the HostedZone Id in cdk.context.json

Other Information

See also

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

v2

Environment details (OS name and version, etc.)

typescript amazon-linux

@girotomas girotomas added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 30, 2024
@github-actions github-actions bot added the @aws-cdk/aws-route53 Related to Amazon Route 53 label May 30, 2024
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@aws-cdk-automation
Copy link
Collaborator

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-route53 Related to Amazon Route 53 feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants