Deploy a Node.js function to AWS Lambda using the Serverless Framework

Share this video with your friends

Send Tweet

In this lesson we walk through the necessary configuration of a Lambda function, add a simple code snippet and then deploy the function to AWS Lambda. We test it using the invoke command coming with the CLI tool.

xuan
xuan
~ 6 years ago

I did exactly what you teach, but my command: sls invoke --function helloWorld --log

Return nothing. Any suggestions? Thanks!

Nik Graf
Nik Graf(instructor)
~ 6 years ago

Hey xuan, is there no output at all? Can you elaborate what's happening?

Dineshchse
Dineshchse
~ 6 years ago

after sls deploy I get this output Serverless: Packaging service... Serverless: Service files not changed. Skipping deployment... Service Information service: my-app stage: dev region: us-east-1 stack: my-app-dev resources: 1 api keys: None endpoints: None functions: None layers: None

but file structure and contents I have same as you did :(

Fernando Balmaceda
Fernando Balmaceda
~ 5 years ago

I have an error when I try to deploy:

Serverless Error:
 
The AWS Access Key Id needs a subscription for the service
Evan Gillogley
Evan Gillogley
~ 5 years ago

The current config will fail. Ensure to use the latest node runtime nodejs10.x or nodejs12.x.