403 forbidden error on S3 REST API HEAD request

前端 未结 4 932
情深已故
情深已故 2021-01-04 22:15

Im trying do do a HEAD Object request to the S3 REST API but I keep getting a 403 Forbidden error, even though I have the policy setup with the necessary permissions on S3.

4条回答
  •  -上瘾入骨i
    2021-01-04 22:48

    Had the same issue but with a different root cause - was trying to create a bucket, and instead of getting a 404, got 403. As S3 is globally namespaced, someone else had created the bucket, so while I had the correct permissions and setup for my account, I still would get 403 from a HEAD request. Solution was to check if the bucket exists globally first, and if so, try a different bucket name.

提交回复
热议问题