Can upload files but can't list S3 bucket objects. Get access denied error

前端 未结 2 1276
孤独总比滥情好
孤独总比滥情好 2021-02-14 13:13

I\'m trying to list all the files in my S3 bucket. But constantly getting the error Access denied. I think I have the necessary permissions in my IAM user :

相关标签:
2条回答
  • 2021-02-14 13:55

    I was having same issue. I was using two machines, one was having aws profile created and I was able to list s3 bucket, but on second machine where my profile was not created and I was using Set-AWSCredential command I was not able to list s3 bucket. Moment I created profile I was able to access s3 ls.

    0 讨论(0)
  • 2021-02-14 14:09

    Just found the answer! The Actions allowed in the policy are correct. The problem is with the Resource. I was using this :

    "Resource": [
       "arn:aws:s3:::bucket/*"
    ]
    

    But it looks like it does not give permission to the root of the bucket. No full access. So, to make it work, we have to remove / like this :

    "Resource": [
       "arn:aws:s3:::bucket*"
    ]
    

    Now it's working like a charm.

    0 讨论(0)
提交回复
热议问题