AccessDenied for ListObjects for S3 bucket when permissions are s3:*

前端 未结 13 792
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 22:02

I am getting:

An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied

When I try to get folder from

相关标签:
13条回答
  • 2021-01-29 22:36

    I got the same error when using policy as below, although i have "s3:ListBucket" for s3:ListObjects operation.

    {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:ListBucket",
                "s3:GetObject",
                "s3:GetObjectAcl"
            ],
            "Resource": [
                "arn:aws:s3:::<bucketname>/*",
                "arn:aws:s3:::*-bucket/*"
            ],
            "Effect": "Allow"
        }
      ]
     }
    

    Then i fixed it by adding one line "arn:aws:s3:::bucketname"

    {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:ListBucket",
                "s3:GetObject",
                "s3:GetObjectAcl"
            ],
            "Resource": [
                 "arn:aws:s3:::<bucketname>",
                "arn:aws:s3:::<bucketname>/*",
                "arn:aws:s3:::*-bucket/*"
            ],
            "Effect": "Allow"
        }
     ]
    }
    
    0 讨论(0)
提交回复
热议问题