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

provider/aws: New Data Source: aws_acm_certificate #8359

Merged
merged 3 commits into from
Nov 4, 2016

Conversation

phinze
Copy link
Contributor

@phinze phinze commented Aug 21, 2016

Use this data source to get the ARN of a certificate in AWS Certificate
Manager (ACM). The process of requesting and verifying a certificate in ACM
requires some manual steps, which means that Terraform cannot automate the
creation of ACM certificates. But using this data source, you can reference
them by domain without having to hard code the ARNs as input.

The acceptance test included requires an ACM certificate be pre-created
in and information about it passed in via environment variables. It's a
bit sad but there's really no other way to do it.

func dataSourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).acmconn
params := &acm.ListCertificatesInput{}
resp, err := conn.ListCertificates(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this API returns results in pages... do we need to handle NextToken in the response in order to see the whole list once a user has lots of certificates?

(Not clear to me whether not setting MaxItems in the request means "give me all of them" or "use the default limit"...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes I had meant to look into this... will dig.

@mitchellh
Copy link
Contributor

Cool! I'll leave you and @apparentlymart to the review but this is a cool data source.

@radeksimko radeksimko mentioned this pull request Sep 15, 2016
Use this data source to get the ARN of a certificate in AWS Certificate
Manager (ACM). The process of requesting and verifying a certificate in ACM
requires some manual steps, which means that Terraform cannot automate the
creation of ACM certificates. But using this data source, you can reference
them by domain without having to hard code the ARNs as input.

The acceptance test included requires an ACM certificate be pre-created
in and information about it passed in via environment variables. It's a
bit sad but there's really no other way to do it.
@jen20 jen20 force-pushed the f-aws-acm-datasource branch 2 times, most recently from f2a9b44 to 3ad4959 Compare November 3, 2016 23:58
@jen20
Copy link
Contributor

jen20 commented Nov 4, 2016

Test Run:

TF_ACC=1 go test ./builtin/providers/aws -v -run TestAccAwsAcmCertificateDataSource_basic -timeout 120m
=== RUN   TestAccAwsAcmCertificateDataSource_basic
--- PASS: TestAccAwsAcmCertificateDataSource_basic (21.51s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    21.534s

@phinze
Copy link
Contributor Author

phinze commented Nov 4, 2016

LGTM @jen20 - I can't approve via reviews since I was the original author lol

@jen20 jen20 merged commit c75369d into master Nov 4, 2016
@radeksimko radeksimko deleted the f-aws-acm-datasource branch November 4, 2016 12:00
@ghost
Copy link

ghost commented Apr 20, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants