跳至内容

Object URL is broken

0

I uploaded a pdf to an S3 bucket but I get this error when I click the object URL.. <Error> <Code>AccessDenied</Code> <Message>Access Denied</Message> <RequestId>BB274AWF5TTTHMQ8</RequestId> <HostId>tGH1/69mLnvU4/UcUpY6Ay6EyweVK738qEL9/bSL/gWsg6io2hEfmkqtjDTPWJnySBTQpL87flVOS/MECv4cXA==</HostId> </Error>

已提问 2 年前518 查看次数
3 回答
0

Please see answer to your question in the following link. https://repost.aws/knowledge-center/s3-access-denied-error

已回答 2 年前
0

Here are the key points to address your issue with the "Access Denied" error when trying to access an object in an S3 bucket: 1- Verify the IAM permissions associated with the identity (user, role, etc.) that is trying to access the S3 bucket and object. Ensure the necessary permissions are granted to perform the required actions (e.g. s3:GetObject).

2- Check the S3 bucket policy to ensure it allows the necessary access to the object. The bucket policy should be configured to grant the appropriate permissions to the IAM identity trying to access the object.

3- Confirm that the S3 bucket and object are not set to public access, as this could also cause an "Access Denied" error if the IAM identity does not have the necessary permissions.

4- If you are using an AWS KMS key to encrypt the object, ensure the key is enabled and the IAM identity has the required permissions to use the KMS key for decryption.

Sources

[1] Troubleshoot errors when creating an S3 bucket | AWS re:Post

[2] Troubleshoot the ciphertext error when accessing an S3 object | AWS re:Post

[3] Troubleshoot 403 Access Denied error in Amazon S3 | AWS re:Post

AWS
已回答 2 年前
0

You need to grant access to your bucket objects from the outside world, so you need to go to the Permissions tab in the bucket then you need to ensure that the:

  1. Block public access (bucket settings) is unticket and save the changes
  2. Bucket policy has the following json:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PublicReadGetObject",
            "Effect": "Allow",
            "Principal": "*",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": [
                "arn:aws:s3:::Bucket-Name/*"
            ]
        }
    ]
}

See the official doc for more info https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteAccessPermissionsReqd.html

NOTE This is not a security best practice but will make you going, (consider accessing your objects through cloudfront)

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。