-
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
CloudFront etags being updated even on failed apply. State file not updated with new etags #23949
Comments
Hey @frankloye 👋 Thank you for taking the time to raise this! So that we have all of the necessary information in order to look into this, can you update the issue description to include the Terraform version you're running, as well as the (redacted as needed) debug logs? I also noticed that you're using an older version of the AWS Provider. A quick check of the changelog seems to indicate that a number of bug fixes have occurred within the |
After further investigation, it seems like the issue is actually with the CloudFront Key Group Resource. When the public key value changes, the CloudFront Key Group Resource is updating the eTag on the associated CloudFront Distribution, but is not updating the distribution’s eTag in the state file. Which results in the precondition failed error when we try to update the CloudFront Distribution because our eTag in state does not match the eTag on the distribution. Please let me know if I should open a new case or update the existing one. |
Hey @frankloye -- thank you for that update. So as to prevent any possible confusion, can you open a new issue with that information in mind? |
Created new issue: #24033 |
Hey @frankloye 👋 Thank you for taking the time to open that! Given that we've migrated over to that issue with the new information, is it safe to say that this one can be closed? |
Yes. Closing this issue. |
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. |
Community Note
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
CloudFront Distribution etags are not updated unless the apply is successful and state file etag values will always match the distribution etag values if updates are all made through terraform
Actual Behavior
CloudFront Distribution etags are being updated even when the apply fails and state file etag values are not being updated to reflect the new CloudFront Distribution etags
Error: error updating CloudFront Distribution (XXXXX): PreconditionFailed: The request failed because it didn't meet the preconditions in one or more request-header fields.status code: 412
Steps to Reproduce
terraform apply
The text was updated successfully, but these errors were encountered: