我有一个通过serverless deploy
部署的lambda,它在
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless Error ---------------------------------------
Access Denied
我的公司对S3有非常严格的限制。我怎么知道哪个S3存储桶被拒绝访问,所以我请求访问? serverless.yml
看起来像这样:
service: some-lambda-name
provider:
name: aws
runtime: python3.6
stage: 'staging'
region: us-east-1
role: arn:aws:iam::12345:role/some-lambda
memorySize: 512
deploymentBucket:
name: lambda-bucket-staging
functions:
some-lambda-name:
name: some-lambda-name
handler: some-lambda-name.lambda_handler
memorySize: 128
编辑:
在terraform中我的部署角色对我期望部署到的存储桶的总访问权限:
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::lambda-bucket-staging",
"arn:aws:s3:::lambda-bucket-staging/*"
]
}
答案 0 :(得分:0)
确保正确设置了操作资源,并且aws资源具有公共访问权限等。
例如,这里是允许访问假人力资源帐户存储桶的权限;通知资源不尽相同!
JSON动作资源示例: