squ*_*ave 4 amazon-s3 aws-lambda serverless
我正在尝试将一个简单的 lambda 函数部署到 aws,但我收到错误Missing required key 'Bucket' in params。我创建的用户拥有完整的 Lambda、S3、Cloudformation 和 Cloudwatch 访问权限。
JS
'使用严格';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};
callback(null, response);
// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
};
Run Code Online (Sandbox Code Playgroud)
YAML
service: lambda-demo
provider:
name: aws
runtime: nodejs6.10
functions:
hello:
handler: handler.hello
Run Code Online (Sandbox Code Playgroud)
大多数情况下,当 IAM 用户权限在“sls 部署”运行之间更改或一开始不正确时,我都会遇到此错误。
最佳做法是转到 AWS 控制台 -> CloudFormation 并检查 CloudFormation 事件日志以了解发生了什么。如果日志显示权限错误,请修复权限,删除从控制台创建的无服务器堆栈并再次运行“sls deploy”。
| 归档时间: |
|
| 查看次数: |
10717 次 |
| 最近记录: |