-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Conversation
There was a problem hiding this 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" { |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
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)) |
There was a problem hiding this 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)
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! |
Community Note
Relates #7873
Release note for CHANGELOG:
Output from acceptance testing: