-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_acm_certificate is eventually consistent, causes direct dependencies to fail #4687
Comments
@MetricMike does it work if you use the ACM certificate validation via DNS is generally fast but sometimes can take upwards of an hour. If it still fails with the validation resource, then we should probably consider the retry logic. Edit: Sorry just noticed your explicit expected behavior note.
If there is some sort of eventual consistency after successful validation (via the validation resource), we would implement a retry loop for 1-5 minutes on specific certificate error messages in downstream resources, but downstream resources should not contain any specific logic pertaining to ACM certificate validation itself. We try to keep a pretty strict delineation between resources and especially services. |
Bother, I knew I was going to mess up that pseudo code.
I'm not terribly familiar with terraform internals, but looking at the code for the validation resource I'm not sure there's much it can do after detecting |
No worries 😄 In that case, it sounds perfectly valid to add a 1 minute retry loop during create/update for that specific error message. I'll submit a quick PR and kick off the acceptance testing (which takes awhile). |
Submitted PR: #4698 |
Sorry to be a pain, but this also affects:
|
We'll need the exact error messages for the other resources |
This issue was automatically closed by #4698 for handling this in the updated I do agree though that we should handle this in the other resources, but its generally easier to tackle each one separately as we'll need the exact messages and can be handled in new issues 👍 |
The |
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
Terraform Version
Terraform v0.11.7
AWS Provider v1.20
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
aws_cloudfront_distribution.distro
should wait foraws_acm_certificate.cert
to validate and be available before attempting to attach it as thedistro
'sviewer_certificate
.Actual Behavior
It appears that ACM certificates are subject to the same "eventual consistency" that IAM server certificates are and can take up to a few minutes after validation is complete to be available for other AWS resources to use.
Steps to Reproduce
aws_cloudfront_distribution
oraws_elb
with a direct dependency onaws_acm_certificate
that needs to be created.aws_acm_certificate
data source or adding an intermediary dependency (such as anull_resource
that callssleep 10
) will succeed.I haven't tested with email validation, or the
aws_lb
resource, but I have no reason to believe they'd have different behavior.References
aws_iam_server_certificate
)The text was updated successfully, but these errors were encountered: