-
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
resource/aws_acm_certificate_validation: Prevent crash on validation_record_fqdns #3336
resource/aws_acm_certificate_validation: Prevent crash on validation_record_fqdns #3336
Conversation
…record_fqdns Other changes: * Will retry until domain validation options are actually available when using validation_record_fqdns * Will now return an error if validation_record_fqdns is used on EMAIL validation method ACM certificates * Add docs example for email validation * Fix docs link to aws_acm_certificate instead of self-reference
@bflad Have you seen the #2813 (comment). This is pretty much limiting usage. Is it possible to fix this part as well? |
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.
@cemo I think we should be fixing one bug at a time and this PR already has a large scope, so I'm happy for keeping it as is and fixing the mentioned thing in a separate PR.
Reviewing bigger PRs with multiple fixes is much more difficult and creates more room for error. It's IMO better to prevent introducing even more bugs that way.
@bflad I have mixed feelings about supporting email confirmations in general. I feel like it's out of the usual/expected scope of Terraform, because email confirmation is rarely well automated and letting user wait until someone clicks a link is odd.
That said I'm ok with this PR as it's fixing the crash and that's important.
CertificateArn: cert.CertificateArn, | ||
} | ||
err := resource.Retry(1*time.Minute, func() *resource.RetryError { | ||
log.Printf("[DEBUG] Certificate domain validation options empty, retrying") |
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.
Nitpick: Having the cert ARN in the log message would make it IMO more helpful.
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.
Oh good catch! Will add
return resource.NonRetryableError(err) | ||
} | ||
if len(output.Certificate.DomainValidationOptions) == 0 { | ||
return resource.RetryableError(errors.New("Certificate domain validation options empty")) |
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.
Nitpick: Likewise ^
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.
👍
Me too and it certainly is 😂 but I imagine some (unfortunate) environments are stuck with email validation for whatever reason, so even if its janky, it provides them a starting path into Terraform usage. There's no technical reason to prevent it as the support on our end was simply allowing the additional validation method to pass through to the ACM API in the certificate resource and prevent email validation from working with this DNS-specific attribute in the validation resource. Email validation can timeout just the same as if ACM's DNS validation system has issues. |
…ation_record_fqdns logs
This has been released in version 1.10.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #3330
Other changes: