0.12.20
2.54
resource "aws_s3_bucket_object" "foo-archive" {
key = "foo.sh"
bucket = aws_s3_bucket.foo_bucket.bucket
source = foo.path
server_side_encryption = "aws:kms"
}
Resource creation is successful.
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.
Just define a standard S3 bucket object like so and run apply:
resource "aws_s3_bucket_object" "foo" {
bucket = "some-bucket"
key = "/foo"
source = "${path.module}/foo"
}
Eventually, you get:
Error: error listing tags for S3 Bucket (foo-test-1f0mzi-foo-cache) Object (/foo): NoSuchKey: The specified key does not exist.
status code: 404
It looks like the usual "eventual consistency" in AWS API.
For example, in my CloudTrail log, I see that the between the bucket creation and probing its tagging there were 0.014 seconds... a retry should be added
(I have seen similar AWS API behaviour in other services as well)
Most helpful comment
It looks like the usual "eventual consistency" in AWS API.
For example, in my CloudTrail log, I see that the between the bucket creation and probing its tagging there were
0.014seconds... a retry should be added(I have seen similar AWS API behaviour in other services as well)