0
votes

I want to make my aws bucket public, I have uploaded some images and now I want to access all using backend but object url not working in any case.

Already tried-

  1. Make the bucket policy public.
  2. Already 'Public access' enable.
  3. Disable 'Block all public access'.

Upload using flutter app

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>13CF32E47FC7A79D</RequestId>
<HostId>
z5CK+xZJJwb15rP/JKyRXnw13XPvO/qwpdeXpcphehm3bE6Tl89qGN/+wiK3m+QcTA0/ESV+/uY=
</HostId>
</Error>
1
How do you set the public policy? Please upload your policy. - Lamanus
{ "Version": "2012-10-17", "Id": "Policy1571703334970", "Statement": [ { "Sid": "Stmt1571703328363", "Effect": "Allow", "Principal": "", "Action": "s3:", "Resource": "arn:aws:s3:::bucket-name" } ] } - Akshay Jaiswal

1 Answers

1
votes

How can I grant public read access to some objects in my Amazon S3 bucket?

You need to make bucket public and add Bucket Policy into your bucket Permissions settings. Example:

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