我想将读取(下载)权限授予单个用户。 我对我应该使用的东西感到困惑:
我应该使用
我使用了内联策略,它不起作用:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import sys, os
AWS_KEY = ''
AWS_SECRET = ''
from boto.s3.connection import S3Connection
conn = S3Connection(AWS_KEY, AWS_SECRET)
bucket = conn.get_bucket('staging')
for key in bucket.list():
print key.name.encode('utf-8')
当我使用Boto时:
Traceback (most recent call last):
File "listing_bucket_files.py", line 20, in <module>
bucket = conn.get_bucket('staging')
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 503, in get_bucket
return self.head_bucket(bucket_name, headers=headers)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 536, in head_bucket
raise err
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
我收到以下错误:
.AddConditionalFormat().WhenEquals("=$B1")
答案 0 :(得分:0)
您没有分配"s3:ListBucket"
权限,该帐户在访问staging
和prod
的存储分区时停止,然后无权访问文件/文件夹在这些桶里。
请记住,您必须按照以下方式单独编写代码,并且不要在存储桶名称后添加/*
。
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::staging",
"arn:aws:s3:::prod",
]
},