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
Source: AWS Serverless Computing
AWS Lambda
Steps to create a Lambda activated by API Gateway
- Log in to AWS Console
- Create a new Lambda
- Configure API Gateway
- Configure Lambda Security
- Edit Code
- Publish
- Lambda WYSIWYG lacks basic IDE functionalities.
- One file
- 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
- Install Serverless
- Create from template or create handler.js and serverless.yml
- Test locally using serverless-offline
- Deploy to AWS
Steps to create a Lambda activated by API Gateway
Tag: hello-world
- Update serverless.yml to define table in DynamoDB
- Update serverless.yml to handle different http methods
- Hack away
- Deploy to AWS
Creating a CRUD Todo application with DynamoDB storage
Tag: todos
- Update serverless.yml to add index to DynamoDB
- Update serverless.yml to handle different SNS events
- Hack away
- 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
- 2,755