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

Retry ACM certificate domain validation #9598

Merged
merged 1 commit into from
Aug 5, 2019

Conversation

jdenly
Copy link
Contributor

@jdenly jdenly commented Aug 2, 2019

When the DomainValidationOptions array is completely empty, retry the validation options retrieval.

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

Closes #9596

Release note for CHANGELOG:

Resolves certification validation issues in AWS ap-southeast-2 region where the DomainValidationOptions array may be initially returned by AWS as completely empty.

Output from acceptance testing:

$ AWS_DEFAULT_REGION=ap-southeast-2 make testacc TESTARGS='-run=TestAccAWSAcmCertificate_dnsValidation'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSAcmCertificate_dnsValidation -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSAcmCertificate_dnsValidation
=== PAUSE TestAccAWSAcmCertificate_dnsValidation
=== CONT  TestAccAWSAcmCertificate_dnsValidation
--- PASS: TestAccAWSAcmCertificate_dnsValidation (35.06s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       35.091s

@jdenly jdenly requested a review from a team August 2, 2019 02:54
@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 2, 2019
@bflad bflad added bug Addresses a defect in current functionality. upstream Addresses functionality related to the cloud provider. labels Aug 5, 2019
@bflad bflad self-assigned this Aug 5, 2019
@bflad bflad added this to the v2.23.0 milestone Aug 5, 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.

Hi @jdenly 👋 Thank you very much for this fix! It was correctly fixing the issue at hand for new ACM certificates, however one concern that we have noticed in real world usage with ACM is that DomainValidationOptions can sometimes disappear after awhile (months?) after validation. To combat this, I'm merging this in with a slight adjustment to the conditional, to verify that indeed the certificate is in the PENDING_VALIDATION state for returning this error:

if len(certificate.DomainValidationOptions) == 0 && aws.StringValue(certificate.Status) == acm.DomainStatusPendingValidation {

Output from acceptance testing:

--- PASS: TestAccAWSAcmCertificate_imported_IpAddress (9.37s)
--- PASS: TestAccAWSAcmCertificate_emailValidation (13.83s)
--- PASS: TestAccAWSAcmCertificate_imported_DomainName (14.90s)
--- PASS: TestAccAWSAcmCertificate_root_TrailingPeriod (14.93s)
--- PASS: TestAccAWSAcmCertificate_root (15.02s)
--- PASS: TestAccAWSAcmCertificate_wildcardAndRootSan (15.33s)
--- PASS: TestAccAWSAcmCertificate_dnsValidation (15.36s)
--- PASS: TestAccAWSAcmCertificate_san_single (15.55s)
--- PASS: TestAccAWSAcmCertificate_wildcard (17.23s)
--- PASS: TestAccAWSAcmCertificate_rootAndWildcardSan (17.71s)
--- PASS: TestAccAWSAcmCertificate_san_TrailingPeriod (18.28s)
--- PASS: TestAccAWSAcmCertificate_san_multiple (20.65s)
--- PASS: TestAccAWSAcmCertificate_tags (30.03s)

This also fixes up the aws_acm_certificate_validation testing as well.

@bflad bflad merged commit 99f6d1e into hashicorp:master Aug 5, 2019
bflad added a commit that referenced this pull request Aug 5, 2019
@falgofrancis
Copy link

@jdenly @bflad Thank you very much for fixing the issue. What are the chances of an earlier release?

@ghost
Copy link

ghost commented Aug 7, 2019

This has been released in version 2.23.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!

@falgofrancis
Copy link

Thank you

@ghost
Copy link

ghost commented Nov 2, 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 2, 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/XS Managed by automation to categorize the size of a PR. upstream Addresses functionality related to the cloud provider.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_route53_record.test_cert_validation issue with aws provider
3 participants