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

d/acm_certificate: add tags attribute #11659

Merged
merged 3 commits into from
Apr 23, 2020

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Jan 18, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #10688

Release note for CHANGELOG:

data_source_aws_acm_certificate: add `tags` attribute

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAcmCertificateDataSource_'
--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (139.64s)

@DrFaust92 DrFaust92 requested a review from a team January 18, 2020 16:28
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/acm Issues and PRs that pertain to the acm service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Jan 18, 2020
Copy link
Contributor

@slapula slapula left a comment

Choose a reason for hiding this comment

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

LGTM

@gdavison gdavison added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 22, 2020
@gdavison gdavison self-assigned this Apr 22, 2020
@gdavison
Copy link
Contributor

Hi @DrFaust92. It's not super clear, but #1918 is asking for tags to be a search criteria on the aws_acm_certificate data source.

However, the aws_acm_certificate data source functionally only accepts the domain for discovery. Discovery with tags allows matching on similar domain certificates through a method that is commonly accepted with other data sources.

I can merge this PR as-is, but set it so it won't close the Issue, or search by tags could be added. Let me know how you'd like to proceed.

@DrFaust92
Copy link
Collaborator Author

@gdavison I removed the issue relation from the PR, we can merge this as is I'll open a different PR to filter by tags

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 22, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

One change to make, otherwise the code looks good. I'll be able to run the acceptance tests after the change is made.

@@ -169,6 +171,16 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e
d.SetId(time.Now().UTC().String())
d.Set("arn", matchedCertificate.CertificateArn)

tags, err := keyvaluetags.AcmListTags(conn, d.Id())
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to pass matchedCertificate.CertificateArn here for the ID, instead of d.Id(). I'm asking internally why, but d.Id() is set to the UTC time a few lines above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done + tested to some degree:

--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (139.64s)

@DrFaust92 DrFaust92 requested a review from gdavison April 23, 2020 14:25
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

--- PASS: TestAccAWSAcmCertificateDataSource_KeyTypes (11.86s)

@@ -76,7 +76,7 @@ func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) e
statusStrings := statuses.([]interface{})
params.CertificateStatuses = expandStringList(statusStrings)
} else {
params.CertificateStatuses = []*string{aws.String("ISSUED")}
params.CertificateStatuses = []*string{aws.String(acm.CertificateStatusIssued)}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I missed that

@gdavison gdavison added this to the v2.59.0 milestone Apr 23, 2020
@gdavison gdavison merged commit 3963e4d into hashicorp:master Apr 23, 2020
@ghost
Copy link

ghost commented Apr 24, 2020

This has been released in version 2.59.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 24, 2020
@DrFaust92 DrFaust92 deleted the d/acm-cert-tags branch June 23, 2020 11:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/acm Issues and PRs that pertain to the acm service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants