Book Image

AWS Lambda Quick Start Guide

By : Markus Klems
Book Image

AWS Lambda Quick Start Guide

By: Markus Klems

Overview of this book

AWS Lambda is a part of AWS that lets you run your code without provisioning or managing servers. This enables you to deploy applications and backend services that operate with no upfront cost. This book gets you up to speed on how to build scalable systems and deploy serverless applications with AWS Lambda. The book starts with the fundamental concepts of AWS Lambda, and then teaches you how to combine your applications with other AWS services, such as AmazonAPI Gateway and DynamoDB. This book will also give a quick walk through on how to use the Serverless Framework to build larger applications that can structure code or autogenerate boilerplate code that can be used to get started quickly for increased productivity. Toward the end of the book, you will learn how to write, run, and test Lambda functions using Node.js, Java, Python, and C#.
Table of Contents (8 chapters)

Creating a serverless project

In the previous section, we installed the Serverless framework and tried out the command line. Now, let's create our first serverless project. We are going to use the Serverless framework to create a simple Node.js lambda function and a REST API. Open Terminal and create a directory where you can place your serverless project files. I named it app, but you can name it whatever you want. Go to that directory and open your preferred IDE. I used the Atom editor. When the Atom editor was opened in my empty directory, I used an Atom package at terminal plus to open a new Terminal window inside my IDE. This makes it easier because I don't need to switch between writing code and typing in commands. So, let's type in a command to scaffold a serverless service:

serverless create --template aws-nodejs

The command for creating a service is created...