Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make all files in an S3 bucket public?

My S3 Bucket was private. But now I have updated it to be public. I still can't seem to access the files without signing the URL etc. How do I make all of them public?

like image 434
blue_zinc Avatar asked Jan 12 '15 23:01

blue_zinc


People also ask

How do I make my S3 bucket from private to public?

Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Bucket name list, choose the name of the bucket that you want. Choose Permissions. Choose Edit to change the public access settings for the bucket.

Can S3 be made public?

By default, new buckets, access points, and objects don't allow public access. However, users can modify bucket policies, access point policies, or object permissions to allow public access. S3 Block Public Access settings override these policies and permissions so that you can limit public access to these resources.

Is S3 public or private by default?

By default, all S3 buckets are private and can be accessed only by users who are explicitly granted access. Restrict access to your S3 buckets or objects by doing the following: Writing IAM user policies that specify the users that can access specific buckets and objects.


1 Answers

To make all objects in a bucket publicly readable, create a Bucket Policy on that specific bucket, which grants GetObject permissions for anonymous users. Replace "examplebucket" with the name of the bucket. You can add the Bucket Policy in the Amazon S3 Management Console, in the Permissions section.

{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"AddPerm",
        "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::examplebucket/*"
      ]
    }
  ]
}
like image 176
John Rotenstein Avatar answered Sep 17 '22 17:09

John Rotenstein