Question:
I’m pushing files to an S3 bucket and the bucket owner cannot see the files while my role is granted access to write to the bucket. I’m not sure why this is and was hoping I would have to programatically force bucket-owner-full-control
.
Simple Code Blob:
1 2 3 4 |
ObjectMetadata metadata = constructMetadata(); PutObjectRequest request = new PutObjectRequest(bucketName, filename, data, metadata); s3Supplier.get().putObject(request); |
It uploads successfully, but not seen by the bucket owner. Any reason as to why this would be?
Answer:
The S3 objects are owned by the AWS Account that writes them. By default, Only the object owner has all privileges on the object and is not accessible by others, including the bucket owner, unless the access is explicitly granted (via ACL).
This example from AWS documentation explains how to grant access to the bucket owner for such objects.