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

DnsValidatedCertificate doesn't support validationDomains #7777

Closed
jimfum opened this issue May 4, 2020 · 12 comments
Closed

DnsValidatedCertificate doesn't support validationDomains #7777

jimfum opened this issue May 4, 2020 · 12 comments
Assignees
Labels
@aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager guidance Question that needs advice or information.

Comments

@jimfum
Copy link

jimfum commented May 4, 2020

https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-certificatemanager.DnsValidatedCertificate.html

Issue: The docs offers optional validationDomains prop which suggests you can create one certificate for e.g. click.mydomain.com and click.mydomain.co.uk (through subjectAlternativeNames) and specify the parent domains for both where the domain validation happens. However, at the same time there's a mandatory prop hostedZone - one zone in which the validation record is created (i.e. cannot be both mydomain.com and mydomain.co.uk).


This is a 📕 documentation issue

@jimfum jimfum added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 4, 2020
@moatazelmasry2
Copy link
Contributor

Nop I think this is a misunderstanding on your side. Both in cdk and not cdk (cloudformation, api, ui) etc.. you can provide alternative names only for the same domain. So you create a certificate for

And it doesn't really matter, which one is the main domain name and which are the alternative names, most important they all belong to the same domain name (i.e. same hosted zone).

@jimfum
Copy link
Author

jimfum commented May 5, 2020

Getting confused here. Through the console I've created a single certificate for link.company.com with alternative names link.company.co.uk and link.company.ie. I've validated the individual domains by manually adding verification entries to zones company.com, company.co.uk and company.ie. The certifikace was validated and was usable in CloudFront.
The same is doable with https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-certificatemanager.Certificate.html by providing validationDomains map with the above information (e.g. { "link.company.com":"company.com", "link.company.co.uk":"company.co.uk"... }) and then adding the generated verification CNAMEs to the domains.

@moatazelmasry2
Copy link
Contributor

Hmm my bad then. I always thought this is not possible at least in cfn. Need to verify. Otherwise you probably have found then a missing feature in cdk

@jimfum
Copy link
Author

jimfum commented May 5, 2020

Thanks. There was a fix to make DnsValidatedCertificate working with your scenario a while back I noticed but my use case isn't covered. The Certificate construct can do it (without the validation part obviously) while DnsValidatedCertificate cannot even though it gives impression it can based on the similar documentation as Certificate.

@SomayaB SomayaB added the @aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager label May 5, 2020
@SomayaB SomayaB added documentation This is a problem with documentation. docs/generated Related to the generated API Reference documentation labels May 5, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label May 19, 2020
@skinny85 skinny85 changed the title certificatemanager.DnsValidatedCertificate incorrect as it doesn't support validationDomains? DnsValidatedCertificate doesn't support validationDomains Jun 29, 2020
@skinny85
Copy link
Contributor

Hi @jimfum ,

thanks for opening the issue, but DnsValidatedCertificate does support the validationDomains property: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-certificatemanager.DnsValidatedCertificate.html#validationdomains-span-class-api-icon-api-icon-experimental-title-this-api-element-is-experimental-it-may-change-without-notice-span

Are you saying it doesn't work somehow for your use case?

Thanks,
Adam

@skinny85 skinny85 added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed docs/generated Related to the generated API Reference documentation documentation This is a problem with documentation. feature-request A feature should be added or improved. labels Jun 29, 2020
@github-actions
Copy link

github-actions bot commented Jul 7, 2020

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jul 7, 2020
@jimfum
Copy link
Author

jimfum commented Jul 7, 2020

Hi @skinny85,

That is right. It didn't work for my use case which is a certificate for a.company.com with alternative names like a.company.co.uk and a,company.ca. One would expect the domain ownership verification records to be created in all three domains but that didn't happen (only in the first .com one did) making the certificate to be never validated. The documentation, by mentioning validationDomains property, gives an impression it's possible but I haven't managed. It's confusing as there's the hostedZone property which is where the domain validation record is created for the main domain (.com) but for the others CDK doesn't ask for their hostedZones so does it try to infer them from validationDomains strings?

Thanks,
Jim

@skinny85
Copy link
Contributor

skinny85 commented Jul 7, 2020

Hey @jimfum ,

could your problems be possibly related to #7995 ?

Thanks,
Adam

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jul 8, 2020
@SomayaB SomayaB added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 10, 2020
@njlynch
Copy link
Contributor

njlynch commented Jul 13, 2020

Hi @jimfum ,

You're correct that the DnsValidatedCertificate's validationDomains property doesn't work for multi-zone DNS validation; it's there for email-based validation.

Native CloudFormation support for DNS validation was just added to the CDK via #8552. There is an example usage of it here; this should be included in the next release. The DnsValidatedCertificate class will remain, but I recommend migrating to the above once released, unless you need cross-region support (requesting a certificate in a different region than the current stack is in). Would this solve your use case?

@jimfum
Copy link
Author

jimfum commented Jul 13, 2020

Hi @njlynch,

This looks like exactly what I'm after. Is it realistic to expect release 1.52 will contain that?

Thanks a lot

@njlynch
Copy link
Contributor

njlynch commented Jul 13, 2020

Is it realistic to expect release 1.52 will contain that?

Yes, the above should be included in the next release (1.52).

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 14, 2020
@jimfum
Copy link
Author

jimfum commented Jul 18, 2020

@njlynch, 1.52 is out and Certificate does what I need. A small thing, when destroying, the DNS validation entries aren't removed.

@jimfum jimfum closed this as completed Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

5 participants