My question is almost the same as this one: How do I limit access to S3 keys in a specific prefix? (In Python/boto)
In summary, my IAM policy gives a user r/w access to keys with a specific prefix in a certain bucket, but the user doesn't have access to the rest of the bucket. boto doesn't handle this correctly because it tries to do some GET or HEAD requests on the bucket root when you write a key. The question linked above deals with read, but I need write.
Using the set_contents_from_filename() method of boto's Key class, I get socket.error: [Errno 32] Broken pipe, even with validate=False on the get_bucket() calls. I suspect the issue is somewhere in boto/s3/connection.py line 536 or 538 or 540, but I haven't found a workaround.
I have checked that this works for a user who has access to the full bucket.
Aucun commentaire:
Enregistrer un commentaire