AWS S3 Bucket Folder Access

0

I have created a S3 buckets with the following folders  website  personal. I have hosted a static website under the website folder and made it public with ACL. I was supposed to keep some files in personal folder and restrict the access to one of my friend. Kindly hep me out on how to proceed. I tried granting access using his canonical id, but failed. Please help me out on all possible solution to this issue.

已提問 9 個月前檢視次數 341 次
1 個回答
0

When ACLs are disabled then use bucket policies to control access. Grant folder level access through s3 resource policy, follow this re:Post thread. But, based on what you described, it seems that you don't want to go this route.

But here in your case, I assume, you'd have already bucket ACL enabled and object ownership would be either Bucket owner or object writer. Granting objects through ACL, you'd need to add canonical id to each object in that folder.

If your bucket uses the bucket owner enforced setting for S3 Object Ownership, you must use policies to grant access to your bucket and the objects in it. With the bucket owner enforced setting enabled, requests to set access control lists (ACLs) or update ACLs fail and return the AccessControlListNotSupported error code. Requests to read ACLs are still supported. Refer Access control list overview

Once you add canonical id to object, that user should be able to access that object using the following command:

  aws s3api get-object --bucket <bucket_name> --key <directory/file_name> --profile <cli_profile> outfile

Hope you find this information helpful.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
專家
已回答 9 個月前
  • Do you have additional questions, happy to help.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南