我正在一个项目中工作,目标是从AmazonS3获取报告。目前,我正在尝试访问S3位置,以检查我的可用桶列表
我在python中工作,我已经在提示符下设置了所有凭据:aws configure
在我的python文件中,当我尝试使用代码列出我的所有存储桶时:
import boto3
s3 = boto3.resource('s3')
for bucket in s3.buckets.all():
print (bucket.name)
我得到了这个错误:
Traceback (most recent call last): File "C:\Users\bakpovo\testAmazon.py", line 3, in for bucket in s3.buckets.all(): File "C:\Users\bakpovo\AppData\Local\Programs\Python\Python38\lib\site-packages\boto3\resources\collection.py", line 83, in iter for page in self.pages(): File "C:\Users\bakpovo\AppData\Local\Programs\Python\Python38\lib\site-packages\boto3\resources\collection.py", line 161, in pages pages = [getattr(client, self._py_operation_name)(**params)] File "C:\Users\bakpovo\AppData\Local\Programs\Python\Python38\lib\site-packages\botocore\client.py", line 276, in _api_call return self._make_api_call(operation_name, kwargs) File "C:\Users\bakpovo\AppData\Local\Programs\Python\Python38\lib\site-packages\botocore\client.py", line 586, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
有人知道发生了什么吗?我的皱纹不好吗
谢谢
谢谢大家的回答。我解决了我的问题。 我刚刚在shell语法中添加了s3位置,如下所示:
这就是工作
相关问题 更多 >
编程相关推荐