问题描述
我有一个桶我在Amazon S3的组织,它看起来像 mydev.orgname
I have a bucket for my organization in Amazon S3 which looks like mydev.orgname
-
我有一个Java应用程序,它可以连接到Amazon S3的凭据,并可以连接到S3,创建,读取文件
I have a Java application that can connect to Amazon S3 with the credentials and can connect to S3, create, read files
我有一个要求,其中一个应用程序从同一个桶中读取的Python的数据。所以我使用博托这一点。
I have a requirement where a application reads the data from Python from same bucket. So I am using boto for this.
我下面在奥得河,以获得斗
I do the following in oder to get the bucket
>>> import boto
>>> from boto.s3.connection import S3Connection
>>> from boto.s3.key import Key
>>>
>>> conn = S3Connection('xxxxxxxxxxx', 'yyyyyyyyyyyyyyyyyyyyyy')
>>> conn
S3Connection:s3.amazonaws.com
现在,当我试图让斗我看到错误
Now when I try to get bucket I see error
>>> b = conn.get_bucket('mydev.myorg')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/boto/s3/connection.py", line 389, in get_bucket
bucket.get_all_keys(headers, maxkeys=0)
File "/Library/Python/2.7/site-packages/boto/s3/bucket.py", line 367, in get_all_keys
'', headers, **params)
File "/Library/Python/2.7/site-packages/boto/s3/bucket.py", line 334, in _get_all
response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>EEC05E43AF3E00F3</RequestId><HostId>v7HHmhJaLLQJZYkZ7sL4nqvJDS9yfrhfKQCgh4i8Tx+QsxKaub50OPiYrh3JjQbJ</HostId></Error>
但是,从Java应用程序的一切似乎工作。
But from the Java application everything seems to work.
难道我做错了什么吗?请指点
Am I doing anything wrong here? Please advice
推荐答案
给我的用户更大的作用之后,这个错误就消失了。是指用户给定的权限get_bucket
After giving my "User" much stronger role, this error was gone. Means User given the permission to get_bucket
这篇关于Python的:亚马逊S3不能得到斗:说403禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!