Policy access public S3

0

I can create a policy so that the elements I upload one by one to an s3 are always public

1 Answer
1

To create an S3 bucket policy that makes all objects uploaded to the bucket publicly accessible, you can define a policy that grants read permissions to everyone (*). Below is an example policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::your-bucket-name/*"
        }
    ]
}

Replace "your-bucket-name" with the name of your S3 bucket. This policy allows anyone (the * symbol in the "Principal") to retrieve (GetObject) any object (*) within the specified bucket.

**To apply this policy: **

  1. Open the Amazon S3 console.
  2. Select your bucket.
  3. Go to the "Permissions" tab.
  4. Click "Bucket Policy".
  5. Paste the policy JSON into the policy editor.
  6. Click "Save".
Nafiu
answered 13 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions