【发布时间】:2018-02-15 08:57:51
【问题描述】:
我正在使用 AWS Lambda 将文件上传到 S3 并使用命令
s3 = boto3.resource('s3')
s3.meta.client.upload_file("/tmp/" + fileName, [BUCKET NAME], fileName)
Lambda 策略也被定义为
{
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::[BUCKET NAME]",
"Effect": "Allow"
},
但是当我运行该函数时,它给出了错误
(<class 'boto3.exceptions.S3UploadFailedError'>,
S3UploadFailedError('Failed to upload /tmp/[FILE NAME] to [BUCKET
NAME]/[FILE NAME]: An error occurred (AccessDenied) when calling the
PutObject operation: Access Denied',), <traceback object at
0x7f61e9d2ec48>)
【问题讨论】:
标签: amazon-web-services amazon-s3 aws-lambda boto boto3