Reputation: 347
My problem is that if I write the Lambda function in VSCode I cannot deploy it to AWS console.
I have an AWS account and provided credentials to use in VSCode. Just testing the deployment of simple Lambda function to AWS Console with serverless deploy
command. So far no success. It creates the bucket on S3 and put zip code there.
ConsoleTest function was created manually in AWS Lambda Console.
My serverless.yml looks like this:
service: myservice
provider:
name: aws
runtime: nodejs12.x
functions:
hello:
handler: handler.hello
events:
- http:
path: users/create
method: get
Result in terminal (I get correctly JSON response)
I was following the official guide: https://serverless.com/framework/docs/providers/aws/guide/deploying/
Any help, please?
Upvotes: 2
Views: 2195
Reputation: 347
Found a solution. Problem was that it created the wrong region. I also installed AWS Cli and specified region into a config file, but added region property to the provider. Not sure which one helped, because basically they do the same function. When I put
service: myservice
provider:
name: aws
runtime: nodejs12.x
stage: development
region: eu-central-1
Everything started to work correctly and deploy to my AWS console.
Upvotes: 6