Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to AWS Lambda for Verizon

Intro to AWS Lambda for Verizon

A quick internal introduction to AWS Lambda for the Verizon Learning & Development group.

Avatar for John Flesch

John Flesch

July 12, 2017

More Decks by John Flesch

Other Decks in Technology

Transcript

  1. FaaS • Functions as a Service 1. Run single purpose

    stateless functions on demand 2. Developers can focus on code, not infrastructure 3. Never pay for idle time
  2. Focus on Code Write Some Code / / i n

    d e x . j s e x p o r t s . h a n d l e r = ( e v e n t , c o n t e x t , c a l l b a c k ) = > { / / D o s o m e t h i n g w i t h ` e v e n t ` c a l l b a c k ( n u l l , { s t a t u s C o d e : 2 0 0 , b o d y : " H e l l o ! " } ) ; } ; Deploy it w/ ClaudiaJS (or Serverless, etc) $ c l a u d i a c r e a t e ­ ­ h a n d l e r i n d e x . h a n d l e r \ ­ ­ d e p l o y ­ p r o x y ­ a p i https://github.com/flesch/aws‑lambda‑quickstart
  3. Usage Now /standup — Slack posts your update to API

    Gateway, triggering a Lambda function that creates a comment on a GitHub issue GraphQL Schema Builder — Stitches together fenced code blocks inside GitHub issues as an executable GraphQL schema github.com/flesch/graphql‑frankenstein Future Auth Audit Report — Sends a report of non‑Verizon logins to IT Security The Learning Album GraphQL API The entire Learning Album Auth app
  4. Express A very minimal Express example: c o n s

    t e x p r e s s = r e q u i r e ( ' e x p r e s s ' ) ; c o n s t a p p = e x p r e s s ( ) ; a p p . g e t ( ' / ' , ( r e q , r e s , n e x t ) = > { r e s . s e n d ( ' H e l l o , W o r l d ! ' ) ; } ) ; a p p . l i s t e n ( 9 0 2 1 ) ;
  5. Express on Lambda https://github.com/awslabs/aws‑serverless‑express c o n s t e

    x p r e s s = r e q u i r e ( ' e x p r e s s ' ) ; + c o n s t { c r e a t e S e r v e r , p r o x y } = r e q u i r e ( ' a w s ­ s e r v e r l e s s ­ e x p r e s c o n s t a p p = e x p r e s s ( ) ; a p p . g e t ( ' / ' , ( r e q , r e s , n e x t ) = > { r e s . s e n d ( ' H e l l o , W o r l d ! ' ) ; } ) ; ­ a p p . l i s t e n ( 9 0 2 1 ) ; + e x p o r t s . h a n d l e r = ( e v e n t , c o n t e x t ) = > p r o x y ( c r e a t e S e r v e r ( a p p ) ,