Getting started with
Serverless & Lambda Functions

12/04/2018, Rome

Luciano Mammino (@loige)

Wi-Fi

 

Access Point: Aula6
Pass: Codemotion

Luciano... who

Find me online:

- Twitter (@loige)

- GitHub (lmammino)

- Linkedin

- Blog (loige.co)

Trainer

I'll do a talk tomorrow!

 

Unbundling the JavaScript
Module Bundler

 

It's about JavaScript modules, Webpack and other cool stuff...

 

12:30/13:10

What is serverless

Compute as functions

Event-based model

Why serverless is good

Scalability

Pay per usage model (compute time * memory)

Managed infrastructure

Forces you to think in microservices

My experience with Serverless

Open source


Enterprise

  • Various solutions for the UK Energy industry: Trading platform, Billing engine, Market data aggregator (Planet 9 Energy)
  • Big data pipeline (~5-20TB/day/customer) to make network data searchable (Vectra.ai)

Let's get this party started

🎉

Requirements!
🤷‍♂️

A nice laptop

Get an AWS account
aws.amazon.com/free

👸
Create an admin user
in your AWS account
loige.link/aws-admin-user

Install
Docker & Docker-Compose
docker.com/community-edition

Create a "workshop" folder

curl -O https://raw.githubusercontent.com/lucpod/serverless-workshop-helper-container/master/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/lucpod/serverless-workshop-helper-container/master/.env~SAMPLE

Edit the .env file

#!/usr/bin/env bash

AWS_ACCESS_KEY_ID=XXX      # <----
AWS_SECRET_ACCESS_KEY=YYY  # <---- 
AWS_REGION=eu-west-1
AWS_OUTPUT_FORMAT=json

Use the helper container

docker pull lucpod/workshop:latest
docker-compose up -d
docker-compose exec workshop bash

Verify

aws sts get-caller-identity
{
    "Account": "123456789012",
    "UserId": "ABCDEFGHIJKLMNOPQRSTU",
    "Arn": "arn:aws:iam::123456789012:user/super-mario"
}

🤝

Agenda

  • Quick introduction (DONE!)
  • Application overview
  • Lesson 1: The frontend (S3 / SPA)
  • Lesson 2: The database (Dynamo DB)
  • Lesson 3: Understanding Lambda (Lambda / Api Gateway)
  • Lesson 4: Deploying a Mock Api (SAM)
  • Lesson 5: Integrating the API with DB (AWS SDK)
  • Lesson 6: Advanced APIs (Lambda Body parsing & validation)
  • Lesson 7: Preparing for Background Processing (SNS, SQS)
  • Lesson 8: Background Processing (worker lambda)

Ticketless

Architecture

Frontend: S3 (website mode)

Backend: Api Gateway + Lambda

Database: Dynamo DB

Worker: SNS + SQS + Lambda

Email: Mock SMTP server

Architecture

Agenda

  • Quick introduction (DONE!)
  • Application overview (DONE!)
  • Lesson 1: The frontend (S3 / SPA)
  • Lesson 2: The database (Dynamo DB)
  • Lesson 3: Understanding Lambda (Lambda / Api Gateway)
  • Lesson 4: Deploying a Mock Api (SAM)
  • Lesson 5: Integrating the API with DB (AWS SDK)
  • Lesson 6: Advanced APIs (Lambda Body parsing & validation)
  • Lesson 7: Preparing for Background Processing (SNS, SQS)
  • Lesson 8: Background Processing (worker lambda)

Let's start the lessons!

Thanks :)

Don't forget to submit your evaluation form!