I am using S3 to store some business critical documents. I want the bucket to return a 404 status code when trying to access an object that does not exist in the bucket.
I needed to extend the policy like this:
"Action": [
"s3:Get*",
"s3:List*"
],
"Resource": [
"arn:aws:s3:::bucket_name",
"arn:aws:s3::: bucket_name/*"
],
bucket_name
is needed, because without it you don't get 404 for missing objects, but 403 always, bucket_name/*
is needed to actually access stuff in the bucket.