The bucket does not allow ACLs

0

I take my first steps with AWS. I follow this Tutorial step by step:

Deploying a high-availability PHP application with an external Amazon RDS database to Elastic Beanstalk https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-ha-tutorial.html

I successfully started the environment.

When I try to upload code files I get an error: Service:Amazon S3, Message:The bucket does not allow ACLs.
Failed to deploy application.

I learned a little about ACLs. Stackoverflow recommends choosing "ACLs enable" for bucket S3. And that solves the problem, but...

But the AWS Developer Guide says: “A majority of modern use cases in Amazon S3 no longer require the use of ACLs. We recommend that you keep ACLs disabled. With ACLs disabled, you can use policies to control access to all objects in your bucket”.

How do I proceed, enable or disable ACL?

I learned a little about how I can use policies. But I didn't find a simple working example of what policies I should add.

To start, I'm trying to migrate a simple small website from other hosting.

Friends, can you share best practices or useful working examples on how to do this?

Thanks in advance!

Uplloyd
已提問 1 年前檢視次數 5507 次
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.

profile picture
已回答 1 年前
專家
已審閱 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!

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

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

回答問題指南