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年前5466ビュー
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!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ