Resolve the Access Denied Error in Amazon S3 when viewing uploaded file
Posted by navaneeth on Jul 21, 2020 in General | No comments yet
Before you can access a file that is uploaded to a bucket, you need to apply public permissions using either “ACL settings” or the “bucket policy” tool.
To apply the bucket policy, perform the following steps:
1) Open S3 management console https://console.aws.amazon.com/s3/
2) Choose a bucket, click “Properties”, click “Add bucket policy”.
3) Apply the policy using the policy script or AWS policy generator.
4) The following example policy will grant permissions for all user who got the link to view file located in the examplebucket.
{ "Version": "2008-10-17", "Id": "Policy-id", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::examplebucket/*", "Condition": {} } ] }
For more information, please see the following AWS documentation:
http://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html
http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
Leave a Reply