aws_s3_bucket_object eventual consistency error after object creation #5841
Labels
bug
Addresses a defect in current functionality.
service/s3
Issues and PRs that pertain to the s3 service.
Milestone
Community Note
Terraform Version
0.10.8
Affected Resource(s)
Expected Behavior
Resource creation successful.
Actual Behavior
aws_s3_bucket_object.foo: Failed to get object tags (bucket: some-bucket, key: /foo): NoSuchKey: The specified key does not
As is generally the case with eventual consistency issues, this only happens sometimes.
Steps to Reproduce
Just define a standard S3 bucket object like so and run apply:
This seems like just another Terraform AWS eventual consistency issue. The resource is doing a HeadObject and a GetObjectTagging immediately after the PutObject. In this particular case that I encountered, it was the GetObjectTagging request that hit a 404. I have seen explicit retry logic used by other resources to accommodate eventual consistency, but there doesn't appear to be any in
resource_aws_s3_bucket_object.go
. Resources absolutely should be reading after write to ensure they are in a consistent state, but this needs to be done with some sort of retry/timeout logic.The text was updated successfully, but these errors were encountered: