I'm trying to deploy a simple NodeJS application to aws lambda serverless using aws cli. In the deployment the process, the application throws GeneralService Exception with the following error message.
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)
Below is the serverless.yml file configuration of the application:
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 /