-
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 KeyGroup resource update to eTag on associated CloudFront Distribution not captured in state #24033
Comments
Hi, same issue here when updating an aws_cloudfront_cache_policy or an aws_cloudfront_response_headers_policy linked to a Cloudfront distribution. |
correct me if I'm wrong, but it appears the issue outlined by @enzolupia is also affecting is there a workaround for this? as it stands, it doesn't appear that these resources can be updated in subsequent terraform
|
Best workaround I have currently is to let the first |
@aholthagerty that is the same workaround I am using |
This functionality has been released in v4.13.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. Thank you! |
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
The CloudFront KeyGroup resource should not directly update the CloudFront Distribution. Only the CloudFront Distribution module should update the CloudFront Distribution with the new Key Group values and update the associated eTags.
Actual Behavior
Every time the CloudFront KeyGroup value is changed, the CloudFront KeyGroup module will update the associated CloudFront Distribution with the new PublicKey and KeyGroup values, and change the eTags on the CloudFront Distribution. The updated eTags are not being captured in the state file of the associated CloudFront Distribution, and when an update is needed on the CloudFront Distribution, the update request fails because the eTag values in state do not match the eTag values on the CloudFront Distribution with the following error: 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: