NodeJS 将简单节点js应用程序部署到AWS Lambda无服务器失败,并显示GeneralServiceException

ruarlubt  于 2023-01-25  发布在  Node.js
关注(0)|答案(1)|浏览(155)

我尝试使用aws cli将一个简单的NodeJS应用程序部署到aws lambda serverless。在部署过程中,应用程序抛出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 /
p8h8hvxi

p8h8hvxi1#

升级您的AWS用户凭据:)如果已完成,则覆盖。使用覆盖命令

相关问题