kittu
kittu

Reputation: 7018

Access denied fetching images from amazon s3 with full permissions set

I have updated the bucket policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1536491056397",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::gdesign",
                "arn:aws:s3:::gdesign/*"
            ]
        }
    ]
}

But still get access denied error when I try to access the image url: https://gdesign.s3.us-east-2.amazonaws.com/1536491951672

What else do I need to update on aws?

Upvotes: 0

Views: 835

Answers (2)

Feng Li
Feng Li

Reputation: 1

Im using PHP S3 lib, version 3.82.5, i got access defined when show img in webside too, my solution is when get img url from S3, u may need to call "createPresignedRequest" (Create a pre-signed URL for the given S3 command object) this function. Then every thing will be fine.

Upvotes: 0

kittu
kittu

Reputation: 7018

Choosing the correct region while creating bucket fixed my issue.

Upvotes: 1

Related Questions