Proactivity

Getting Started With Serverless

Source

AWS Lambda & Severless

This post covers AWS Lambdas (If you need it)
_aws-lambda getting started & example_


What is Serverless ?

Serverless is an MIT open-source project, actively maintained by a vibrant and engaged community of developers.
Jump Here

Serverless is tragetting a broader vision/concept - to become a framework for different FaaS providers (not just AWS Lambda)

Serverless Framework - Build applications on AWS Lambda, Google CloudFunctions, Azure Functions, AWS Flourish and more

Getting Started with Serverless

Serverless As Defined By Serverless Folks (Here)

The Serverless Framework helps you develop and deploy your AWS Lambda functions, along with the AWS infrastructure resources they require. It’s a CLI that offers structure, automation and best practices out-of-the-box, allowing you to focus on building sophisticated, event-driven, serverless architectures, comprised of Functions and Events.

A few things the Serverless Framework does differently than a normal application Framework are:

  • It manages your code as well as your infrastructure
  • It supports multiple languages (Node.js, Python, Java, and more)
  • It supports FaaS on Azure, AWS lambda and other similar providers
  • Here are the Framework’s main concepts and how they pertain to AWS and Lambda…

For more verbose information on same , This is the best place to lookup. We’d rather focus on building something up below

What Serverless is and what it isn’t ?

  • Serverless is a framework for FaaS providers. It is not a FaaS provider itself
  • It helps organize code and prepare it for deployment onto FaaS infrastructure(like AWS Lambda)

Steps to building with serverless

  • install serverless globally npm i -g serverless
  • install nvm and be on v4.3 of node (supported by AWS lambda at the moment)
  • clone from starter repository - https://github.com/saurshaz/serverless-starter
  • change code as needed, cd lambda
  • test it offline (using serverless-offline plugin). use sls offline
  • deploy the function(s) by doing sls deploy
    deployment using terminal
  • The endpoint URL you see is the one you can connect to by hitting via http
    (remember though that the lambda is invokable not just via tcp/http calls but can be scheduled triggered via sns also)
  • For example, in above - https://yqmemur7n0.execute-api.us-east-1.amazonaws.com/dev/hello is the URL that can be hit

Any Limitations ?

Well, AWS Lambda is pretty flexible and allows you to explore any code capable logic uploaded and running on AWS. However, it expects the functions to be under a specific size

AWS Lambda Deployment Limits

  • Lambda function deployment package size (.zip/.jar file) 50 MB
  • Size of code/dependencies that you can zip into a deployment package (uncompressed zip/jar size) 250 MB
    AWS limitations