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

final retries creating and checking validation for ACM certificates #9661

Merged
merged 2 commits into from
Aug 12, 2019

Conversation

ryndaniels
Copy link
Contributor

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates #7873

Release note for CHANGELOG:

BUG FIXES
* resource/aws_acm_certificate_validation: Final retries after timeouts creating and checking validation for ACM certificates

Output from acceptance testing:

NA - tests for this have been historically skipped/ignored

@ryndaniels ryndaniels requested a review from a team August 7, 2019 13:42
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/acm Issues and PRs that pertain to the acm service. labels Aug 7, 2019
@ryndaniels ryndaniels added the bug Addresses a defect in current functionality. label Aug 7, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Some feedback below, please reach out with questions! Also, I setup our "main" acceptance testing account up with the correct setup yesterday, so this can be tested there.

@@ -80,6 +80,16 @@ func resourceAwsAcmCertificateValidationCreate(d *schema.ResourceData, meta inte
log.Printf("[INFO] ACM Certificate validation for %s done, certificate was issued", certificate_arn)
return resource.NonRetryableError(resourceAwsAcmCertificateValidationRead(d, meta))
})
if isResourceTimeoutError(err) {
resp, err = acmconn.DescribeCertificate(params)
if *resp.Certificate.Status != "ISSUED" {
Copy link
Contributor

Choose a reason for hiding this comment

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

To prevent potential panics we should prefer to use the AWS Go SDK provided conversion functions and the available ACM service constants for consistency, e.g.

Suggested change
if *resp.Certificate.Status != "ISSUED" {
if aws.StringValue(resp.Certificate.Status) != acm.CertificateStatusIssued {

if isResourceTimeoutError(err) {
resp, err = acmconn.DescribeCertificate(params)
if *resp.Certificate.Status != "ISSUED" {
return fmt.Errorf("Expected certificate to be issued but was in state %s", *resp.Certificate.Status)
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
return fmt.Errorf("Expected certificate to be issued but was in state %s", *resp.Certificate.Status)
return fmt.Errorf("Expected certificate to be issued but was in state %s", aws.StringValue(resp.Certificate.Status))

@ghost ghost added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Aug 9, 2019
@ryndaniels ryndaniels requested a review from bflad August 12, 2019 11:29
Copy link
Contributor

@bflad bflad 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: TestAccAWSAcmCertificateValidation_validationRecordFqdnsEmail (10.62s)
--- PASS: TestAccAWSAcmCertificateValidation_timeout (16.68s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdns (122.77s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcardAndRoot (127.35s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRootAndWildcard (128.23s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRoot (133.44s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcard (161.73s)
--- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsSan (204.42s)
--- PASS: TestAccAWSAcmCertificateValidation_basic (231.27s)

@ryndaniels ryndaniels merged commit 3270b94 into master Aug 12, 2019
@ryndaniels ryndaniels deleted the rfd-retry-acmcert branch August 12, 2019 12:05
@ghost
Copy link

ghost commented Nov 1, 2019

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 Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/acm Issues and PRs that pertain to the acm service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants