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): allow tagging DnsValidatedCertificate #13990

Merged
merged 10 commits into from
Apr 15, 2021

Conversation

timothy-farestad
Copy link
Contributor

@timothy-farestad timothy-farestad commented Apr 6, 2021

Closes #12382

Attempting to implement the fix suggested in #12382 to allow the DnsValidatedCertificate resource to be taggable. Currently, only the custom lambda that is created is tagged, but the certificate provisioned by the lambda is not tagged. This would allow the lambda to pass tags through to the certificate, too.

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 Apr 6, 2021

@njlynch njlynch self-assigned this Apr 13, 2021
@github-actions github-actions bot added the @aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager label Apr 13, 2021
@njlynch njlynch added effort/small Small work item – less than a day of effort p1 pr-linter/exempt-readme The PR linter will not require README changes and removed @aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager labels Apr 13, 2021
@njlynch njlynch changed the title feat(certificatemanager): allow tags to be applied to dnsvalidatedcer… feat(certificatemanager): allow tagging DnsValidatedCertificate Apr 13, 2021
@github-actions github-actions bot added the @aws-cdk/aws-certificatemanager Related to Amazon Certificate Manager label Apr 13, 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.

Looks great, thanks!

I left a few minor comments. Additionally, could you add two more tests:

  1. A test for handler.test.js that shows success if tags are not provided.
  2. A test for dns-validated-certificate.test.ts showing that tags are included as properties of the CustomResource if they are provided.

Comment on lines 103 to 104
const map = new Map(Object.entries(tags));
const result = Array.from(map).map(([Key, Value]) => ({ Key, Value }))
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the new Map here is redundant, unless there's a specific (edge) case I'm missing. The below should work:

Suggested change
const map = new Map(Object.entries(tags));
const result = Array.from(map).map(([Key, Value]) => ({ Key, Value }))
const result = Array.from(Object.entries(tags)).map(([Key, Value]) => ({ Key, Value }))

@@ -34,7 +34,7 @@ See https://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html for more in

DNS validation is the preferred method to validate domain ownership, as it has a number of advantages over email validation.
See also [Validate with DNS](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html)
in the AWS Certificate Manager User Guide.
in the AWS Certificate Manager User Guide. All stack tags will be applied to the DNS validated Certificate.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a little out of place here, and doesn't really need to be here. Our "all features must have README updates" rule is sometimes a bit aggressive.

Suggested change
in the AWS Certificate Manager User Guide. All stack tags will be applied to the DNS validated Certificate.
in the AWS Certificate Manager User Guide.

Comment on lines 63 to 66
/**
* Resource Tags.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-certificatemanager-certificate.html#cfn-certificatemanager-certificate-tags
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/**
* Resource Tags.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-certificatemanager-certificate.html#cfn-certificatemanager-certificate-tags
*/
/**
* Resource Tags.
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-certificatemanager-certificate.html#cfn-certificatemanager-certificate-tags
*/

Comment on lines 49 to 50


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

@mergify mergify bot dismissed njlynch’s stale review April 13, 2021 16:55

Pull request has been modified.

@timothy-farestad
Copy link
Contributor Author

Really appreciate the review, @njlynch, I believe this latest commit addresses the tests as well as the syntax changes suggested.

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.

I made two other minor changes, and this is good to go!

Thanks for the contribution!

@mergify
Copy link
Contributor

mergify bot commented Apr 13, 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).

@rix0rrr
Copy link
Contributor

rix0rrr commented Apr 15, 2021

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Apr 15, 2021

Command refresh: success

Pull request refreshed

@mergify
Copy link
Contributor

mergify bot commented Apr 15, 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: a977780
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Apr 15, 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).

@mergify mergify bot merged commit 8360feb into aws:master Apr 15, 2021
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…13990)

Closes aws#12382 

Attempting to implement the fix suggested in aws#12382 to allow the DnsValidatedCertificate resource to be taggable.  Currently, only the custom lambda that is created is tagged, but the certificate provisioned by the lambda is not tagged.  This would allow the lambda to pass tags through to the certificate, too.  

*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/small Small work item – less than a day of effort p1 pr-linter/exempt-readme The PR linter will not require README changes
Projects
None yet
4 participants