1 Answer
- Newest
- Most votes
- Most comments
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.
Relevant content
- asked 2 years ago
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
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!