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): key algorithm support for PrivateCertificate and Certificate #28597

Merged
merged 14 commits into from
Jan 9, 2024

Conversation

longtv2222
Copy link
Contributor

@longtv2222 longtv2222 commented Jan 6, 2024

Add support for key algorithm when requesting a certificate

keyAlgorithm support for DnsValidatedCertificate is not supported since the construct was deprecated. Added a warning if user tries to use keyAlgorithm for the construct instead.

CloudFormation docs for key algorithm.

Closes #22887.


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

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels Jan 6, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 6, 2024 07:51
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

* If you need to use an algorithm that doesn't exist as a static member, you
* can instantiate a `KeyAlgorithm` object, e.g: `new KeyAlgorithm('RSA_2048')`.
*/
export class KeyAlgorithm {
Copy link
Contributor Author

@longtv2222 longtv2222 Jan 6, 2024

Choose a reason for hiding this comment

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

Allowed values are: RSA_1024 | RSA_2048 | RSA_3072 | RSA_4096 | EC_prime256v1 | EC_secp384r1 | EC_secp521r1 but I only included RSA_2048 | EC_prime256v1 | EC_secp384r1 since imported certificate does not exist in CloudFormation

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I feel like that's the right thing to do for now too. Having the ability to create additional values probably makes up for any edge cases that could come up.

/**
* Specifies the algorithm of the public and private key pair that your certificate uses to encrypt data.
*
* @default KeyAlgorithm.RSA_2048
Copy link
Contributor Author

@longtv2222 longtv2222 Jan 6, 2024

Choose a reason for hiding this comment

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

If keyAlgorithm is undefined, then the default algorithm is RSA_2048 according to doc

@aws-cdk-automation aws-cdk-automation dismissed their stale review January 7, 2024 16:08

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

@laurelmay laurelmay 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 your work on this! I see the PR is still in draft but I happened to be working on something similar so I hope you don't mind getting some comments now 😄

This is a really great addition for certificates!

packages/aws-cdk-lib/aws-certificatemanager/README.md Outdated Show resolved Hide resolved
* If you need to use an algorithm that doesn't exist as a static member, you
* can instantiate a `KeyAlgorithm` object, e.g: `new KeyAlgorithm('RSA_2048')`.
*/
export class KeyAlgorithm {
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I feel like that's the right thing to do for now too. Having the ability to create additional values probably makes up for any edge cases that could come up.

@longtv2222 longtv2222 changed the title feat(certificatemanager): add support for key algorithm for private certificate feat(certificatemanager): add key algorithm support for PrivateCertificate and Certificate Jan 7, 2024
@longtv2222
Copy link
Contributor Author

longtv2222 commented Jan 7, 2024

@kylelaker

Appreciate the feedbacks!! I've added all your PR suggestions

@longtv2222 longtv2222 marked this pull request as ready for review January 7, 2024 19:25
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 7, 2024
Copy link
Contributor

@laurelmay laurelmay left a comment

Choose a reason for hiding this comment

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

Thanks @longtv2222! This looks good to me! This will be a super helpful feature!

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 8, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 8, 2024
@kaizencc kaizencc changed the title feat(certificatemanager): add key algorithm support for PrivateCertificate and Certificate feat(certificatemanager): key algorithm support for PrivateCertificate and Certificate Jan 9, 2024
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

Thanks @longtv2222 and @kylelaker!

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 9, 2024
Copy link
Contributor

mergify bot commented Jan 9, 2024

Thank you for contributing! Your pull request will be updated from main 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: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 343fd95
  • 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 1822cc9 into aws:main Jan 9, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Jan 9, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ACM: Add ability when requesting a PrivateCertificate to choose Key Algorithm
4 participants