[英]How do I return errors on an AWS Lambda function written in Node.js through the AWS API Gateway using the Serverless framework?
[英]Deployment of simple node js application to AWS Lambda Serverless Failing with GeneralServiceException
我正在尝试使用 aws cli 将一个简单的 NodeJS 应用程序部署到 aws lambda 无服务器。 在部署过程中,应用程序抛出 GeneralService Exception 并显示以下错误消息。
Deploying aws-demo to stage dev (us-east-1)
Warning: Not authorized to perform: lambda:GetFunction for at least one of the lambda functions. Deployment will not be skipped even if service files did not change.
× Stack aws-demo-dev failed to deploy (155s)
Environment: win32, node 14.15.5, framework 3.26.0, plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
CREATE_FAILED: HelloLambdaFunction (AWS::Lambda::Function)
Resource handler returned message: "null (Service: Lambda, Status Code: 403, Request ID: 0f60ffeb-add5-4571-856f-72a390ce5be9)" (RequestToken: beefe9c6-32d2-5d7f-f483-d97a6e76b73c, HandlerErrorCode: GeneralServiceException)
下面是应用的 serverless.yml 文件配置:
service: aws-demo
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs12.x
memorySize: 512
stage: dev
timeout: 15
region: us-east-1
functions:
hello:
handler: handler.hello
events:
- http: ANY /{proxy+}
- http: ANY /
升级您的 AWS 用户凭证:) 如果已经完成则覆盖。 使用覆盖命令
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.