-
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: Imported public hosted zone cannot be used to create VpcEndpointServiceDomainName #21004
Comments
As a work-around, we're creating an anonymous class that extends val importedPhz: IHostedZone = PublicHostedZone.fromPublicHostedZoneAttributes(
stack,
"ImportedPHZ",
PublicHostedZoneAttributes.builder()
.hostedZoneId(zone.hostedZoneId)
.zoneName(zone.zoneName)
.build()
)
val phz: IPublicHostedZone = object : IPublicHostedZone {
override fun getNode(): Node = importedPhz.node
override fun getEnv(): ResourceEnvironment = importedPhz.env
override fun getStack(): Stack = importedPhz.stack
override fun applyRemovalPolicy(policy: RemovalPolicy) = importedPhz.applyRemovalPolicy(policy)
override fun getHostedZoneArn(): String = importedPhz.hostedZoneArn
override fun getHostedZoneId(): String = importedPhz.hostedZoneId
override fun getZoneName(): String = importedPhz.zoneName
} This works for now since |
Thanks for reporting this @aamielsan, I've created a PR for this #21007 |
…IPublicHostedZone (#21007) fixes #21004 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…IPublicHostedZone (aws#21007) fixes aws#21004 ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
We're trying to enable private DNS for our VPC endpoint service using an imported public hosted zone.
Using
PublicHostedZone.fromPublicHostedZoneId()
to import the public hosted zone and passing it as a parameter forVpcEndpointServiceDomainName
fails with the error:But
PublicHostedZone.fromPublicHostedZoneAttributes()
returnsIHostedZone
, and using the imported public hosted zone as a parameter forVpcEndpointServiceDomainName
results in a compilation error in Kotlin/Java:Expected Behavior
Expected
PublicHostedZone.fromPublicHostedZoneAttributes()
to returnIPublicHostedZone
.This should also enable
VpcEndpointServiceDomainName
to be created with an imported public hosted zone.Current Behavior
Using an imported public hosted zone from
PublicHostedZone.fromPublicHostedZoneAttributes()
to create aVpcEndpointServiceDomainName
construct results to a compilation error in Kotlin/Java:Reproduction Steps
This test code fails to compile in Kotlin:
Possible Solution
PublicHostedZone.fromPublicHostedZoneAttributes()
method fromIHostedZone
toIPublicHostedZone
. The change should just be a patch/chore, sinceIPublicHostedZone extends IHostedZone
.IHostedZone
forIPublicHosted
works for Typescript since type compatibility is based on structural subtyping. But in nominally-typed languages like Java, this will fail.I may be able to contribute a PR to fix this 🙂
Additional Information/Context
No response
CDK CLI Version
2.27.0
Framework Version
No response
Node.js Version
16.14.2
OS
macOS
Language
Java
Language Version
Java 11
Other information
Changes from pull-request #19771
The text was updated successfully, but these errors were encountered: