September 2018
Intermediate to advanced
266 pages
7h 26m
English
Now that we’ve got the CLI set up, we can use it to make our lives much easier. To create a new function, you need to have a folder containing an index.js file with a basic Lambda code in. Navigate into that folder in your terminal and now you can run these commands:
zip ./index.zip *aws lambda create-function \ --function-name your-function-name \--runtime nodejs8.10 \--role your-lambda-role \ --handler index.handler \ --zip-file fileb://index.zip
Switch out the your-lambda-role for the arn of the role that you created earlier. You can find this by going back to the IAM service in AWS and selecting Roles and clicking on your Lambda role:
When you run this it will return a JSON blob with ...
Read now
Unlock full access