1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
Hi Gouda!
Organizing your scenario:
- Your bucket should be publicly accessible through a URL.
- Anyone can retrieve objects from the bucket.
- Only IAM users can upload (put) objects into the bucket.
You can use the following bucket policy to implement this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
},
{
"Sid": "IAMPutObject",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::YOUR_AWS_ACCOUNT_ID:user/YOUR_IAM_USERNAME"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
}
]
}
Make right replaces on policy.
Remember to attach the necessary S3 permissions to the IAM user's permissions policy to allow uploading objects.
I'll keep tracking your comments to see if you've found a resolution.
답변함 8달 전
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
Agree with the Get object. The PutObject, technically if its in the same account account, you could just use IAM Policies instead of using the bucket policy to grant access.