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

feat(certificatemanager): requesting private certificates issued by Private Certificate Authority #16315

Merged
merged 8 commits into from Nov 1, 2021

Conversation

jumic
Copy link
Contributor

@jumic jumic commented Sep 1, 2021

Support requesting private certificates issued by Private Certificate Authority.

Similar to the existing construct named Certificate, a new construct PrivateCertificate was introduced. There are two main differences between them. PrivateCertificate has an additional property certificateAuthority to specify the Private certificate authority (CA) that will be used to issue the certificate. The validation options are removed because no validation is necessary for private certificates.

Closes #10076.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Sep 1, 2021

@peterwoodworth peterwoodworth added @aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager p1 effort/medium Medium work item – several days of effort labels Sep 1, 2021
@peterwoodworth peterwoodworth changed the title feat(certificatemanager): requesting private certificates issued by Private Certificate Authority feat(certificatemanager): requesting private certificates issued by Private Certificate Authority Oct 21, 2021
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

I'm wondering if we should go about this differently. Rather than add this to Certificate, what if we create a new construct called PrivateCertificate? The PrivateCertificateProps would be limited to domainName, subjectAlternativeNames, and certificateAuthority, with the latter required rather than optional.

I think this will make the intent a bit clearer. There's a public certificate -- with various validation options -- and a private certificate, which requires the use of a private CA and requires no validation. I suspect this will result in less build/synth-time errors and slightly cleaner code.

@mergify mergify bot dismissed njlynch’s stale review November 1, 2021 14:32

Pull request has been modified.

@jumic
Copy link
Contributor Author

jumic commented Nov 1, 2021

Thanks for your feedback. I have implemented the suggested changes and introduced a new construct named `PrivateCertificate. You're right. The code looks much cleaner than before.

I tested the new construct manually with the following examples:

new certificatemanager.PrivateCertificate(this, 'MyCert', {
  certificateAuthority,
  domainName: 'my-cert.me',
});
new certificatemanager.PrivateCertificate(this, 'MyCert', {
  certificateAuthority,
  domainName: 'my-cert.me',
  subjectAlternativeNames: ['*.foo.my-cert.me'],
});

I haven't created an integration test yet because PrivateCertificate depends on acmpca.CertificateAuthority which has to be created manually before. Please let me know if I should add the integration test anyway.

@jumic jumic requested a review from njlynch November 1, 2021 14:51
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! 👍

@mergify
Copy link
Contributor

mergify bot commented Nov 1, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: d163450
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit e26f5be into aws:master Nov 1, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 1, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…rivate Certificate Authority (aws#16315)

Support requesting private certificates issued by Private Certificate Authority. 

Similar to the existing construct named `Certificate`, a new construct `PrivateCertificate` was introduced. There are two main differences between them. `PrivateCertificate` has an additional property `certificateAuthority` to specify the Private certificate authority (CA) that will be used to issue the certificate. The validation options are removed because no validation is necessary for private certificates.

Closes aws#10076.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 effort/medium Medium work item – several days of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aws-certificatemanager] validationDomains does not need to be supplied for PCA certificates
4 participants