-
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
(certificatemanager): DnsValidatedCertificate does not support creating cert for imported hosted zone by id only #13686
Comments
Hi @zxkane , The requirement to use a HostedZone with a name was an explicit decision to allow for the validation shown and prevent deploy-time failures where the hosted zone domain doesn't match the certificate's domain. This validation and restriction have been in place since the initial creation of this construct 2 years ago, and to my knowledge, this is the first time this has been suggested to be a bug. I'd like to understand better what impact this has. Can you explain a bit more what the impact is for you? Is it just the annoyance of having to import by attributes (e.g., |
Hi Nick, Below is my use case,
For above scenario, the ideal user experience is the customer just input the custom domain of web portal and select existing public hosted zone of Route53 for creating custom domain’s DNS record. If the solution also requires an additional input for the domain of the hosted zone of Route 53, it is redundant to the hosted zone id. All of those inputs are CloudFormation parameters in the CDK app, they are tokens not able to be verified by So my proposal is updating the |
I agree we could make this validation -- while useful -- optional. As a work-around, you could import the hosted zone by attributes, and just have the hosted zone name be the desired domain name. This isn't accurate, but given the limited usage here, would be enough to unblock you: new DnsValidatedCertificate(this, 'CustomDomainCertificateForCloudFront', {
domainName: domainNamePara.valueAsString,
hostedZone: HostedZone.fromHostedZoneAttributes(this, 'ImportedHostedZone', {
hostedZoneId: r53HostZoneIdPara.valueAsString,
zoneName: domainNamePara.valueAsString,
}),
region: 'us-east-1',
}); |
This issue also prevents users from creating a DnsValidatedCertificate across account boundaries because |
To create a |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
The
validate()
ofDnsValidatedCertificate
requires the concreted hostname fromIHostedZone
object. Can not create DnsValidatedCertificate only importing a hosted zone from its ID. The hostname is redundant, the hosted zone id is enough for importing existing hosted zone.aws-cdk/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts
Lines 111 to 119 in 0757686
Reproduction Steps
Reproduce the validation error using below code snippet,
What did you expect to happen?
What actually happened?
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: