Python: Amazon S3 cannot get the bucket: says 403 Forbidden
this answer work for me :)
I did
- S3 bucket policy setting
- time setting
- bucket = conn.get_bucket(BUCKET_NAME, validate=False)
Giving the user a "stronger role" is not the correct solution. This is simply a problem with boto
library usage. Clearly, you don't need extra permissions when using Java S3 library.
Correct way to use boto in this case is:
b = conn.get_bucket('my-bucket', validate=False)
k = b.get_key('my/cool/object.txt') # will send HEAD request to S3
...
Basically, boto
by default (which is a mistake on their part IMHO), assumes you want to interact with S3 bucket. Granted, sometimes you do want that, but then you should use credentials that have permissions for S3 bucket operations. But a more popular use case is to interact with S3 objects, and in this case you don't need any special bucket-level permissions, hence the use of validate=False
kwarg.