简体   繁体   中英

Giving an IAM user, permission to a specific folder of a bucket in AWS S3

I am stuck in writing a policy,

Scenario: We have a bucket called BUCKET, and there are two folders, FOLDER1 and FOLDER2 inside it. Now there is one IAM USER, user1. This user should have read/write access to FOLDER1 but not any access in FOLDER2. And user should also able able to list the Folders inside BUCKET. Means user should able to see the folder in which it have the permission.

Any lead will be helpful. Thanks.

Please add a bucket policy with the exact path you want to give access to like below,

 { "Version":"2012-10-17", "Statement":[ { "Sid":"AddCannedAcl", //Here add your Sid "Effect":"Allow", "Principal": {"AWS": ["arn:aws:iam::111122223333:root","arn:aws:iam::444455556666:root"]}, //Here add you users ARN "Action": "s3:*", "Resource":["arn:aws:s3:::examplebucket/YOUR FOLDER/*"] //Here } ] }

我相信这篇博文中提到的示例策略将满足您的要求: 编写 IAM 策略:授予对 Amazon S3 存储桶中用户特定文件夹的访问权限

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM