1 個回答
- 最新
- 最多得票
- 最多評論
1
As the AWS developer guide says, the use of ACLs isn't recommended any more so it's worthwhile spending time learning how to use bucket policies as they give you much more, fine-grained control over who or what can access the bucket.
There are a list of example bucket policies at https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html, and several online tutorials which will explain how to use them.
As example, if you had a prefix of upload
in your folder, you could allow uploads to the folder with a bucket policy similar to
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUpload",
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Resource": ["arn:aws:s3:::<EXAMPLEBUCKET>"],
"Condition": {
"StringEquals": {
"s3:prefix": ["upload"],
}
}
}
]
}
you'll need to replace EXAMPLEBUCKET with your bucket name.
已回答 1 年前
相關內容
- AWS 官方已更新 1 年前
Thanks for the link! How did I miss it :) Thank you Simon for the example. I will look deeper into this issue! And of course, thank you for not passing by my question. Respect to you!