aws-cdk: Exporting/importing HostedZoneIds across CDK apps #30384
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.
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 incdk.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:
cdk.context.json
Other Information
See also
Acknowledgements
CDK version used
v2
Environment details (OS name and version, etc.)
typescript amazon-linux
The text was updated successfully, but these errors were encountered: