SERVERLESS FRAMEWORK

 AUTOMATED AWS LAMBDA +

API GATEWAY USING NODE.JS

Ronak Raithatha

Engineer @ BoomTown

AWS Lambda

AWS Lambda

  • Standalone scripts
  • Event driven execution
  • No infrastructure to manage
  • Built-in auto-scaling
  • Logging and Metrics integrated

In short, AWS Lambda is a compute service which is serverless, and runs in response to events from the AWS ecosystem.

AWS Lambda

Common Use Case: Web Application

AWS Lambda

Common Use Case: Mobile Backend

AWS Lambda

Common Use Case: Big Data Processing

AWS Lambda

Common Use Case: Real-Time Streaming of Data

AWS Lambda

Steps to create a Lambda activated by API Gateway

  1. Log in to AWS Console
  2. Create a new Lambda
  3. Configure API Gateway
  4. Configure Lambda Security
  5. Edit Code
  6. Publish
  1. Lambda WYSIWYG lacks basic IDE functionalities.
  2. One file
  3. No local testing

Serverless Framework

Serverless Framework

Is a command line utility that takes the overhead of AWS Lambda and it's triggers and automates it. 

Under the hood

  • Zips up code
  • Creates a CloudFormation script
  • Executes it on AWS using stored creds
  1. Install Serverless
  2. Create from template or create handler.js and serverless.yml
  3. Test locally using serverless-offline
  4. Deploy to AWS

 

Steps to create a Lambda activated by API Gateway

  1. Update serverless.yml to define table in DynamoDB
  2. Update serverless.yml to handle different http methods
  3. Hack away
  4. Deploy to AWS

Creating a CRUD Todo application with DynamoDB storage

Tag: todos

  1. Update serverless.yml to add index to DynamoDB
  2. Update serverless.yml to handle different SNS events
  3. Hack away
  4. Deploy to AWS

Firing events to SNS using Scheduler

Tag: sns

Server vs. Serverless

Lambda

Cloudwatch

SNS

API Gateway

DynamoDB

Questions?

Serverless Framework

By Ronak Raithatha

Serverless Framework

  • 1,477
Loading comments...

More from Ronak Raithatha