尝试遵循本教程,我在运行Lambda时一直获得"Access Denied"。Lambda是默认的s3-python-get-object
。
lambda的角色为
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::*"
]
}
]
}
用户具有admin权限。我就是不明白为什么会出问题。
From the docs:
If the object you request does not exist, the error Amazon S3 returns depends on whether you also have the s3:ListBucket permission.
If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an HTTP status code 404 ("no such key") error.
If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 ("access denied") error.
上面的代码似乎适合您所做的操作。请确保您有您正在调用的密钥或添加s3:ListBucket
权限以确保错误类型