aws lambda and the serverless cloud -pop-up loft

27
AWS Lambda and the Serverless Cloud Ran Tessler, AWS Solu0ons Architecture Manager

Upload: amazon-web-services

Post on 24-Jan-2018

566 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWSLambdaandtheServerlessCloudRan Tessler, AWS Solu0ons Architecture Manager

Page 2: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – No Infrastructure to Manage

A compute service where you don’t have to think about: •  Servers •  Being over/under capacity •  Deployments •  Scaling and fault tolerance •  OS or language updates •  Metrics and logging

…but where you can easily •  Bring your own code… even

native libraries •  Run code in parallel •  Create backends, event

handlers, and data processing systems

•  Never pay for idle!

Page 3: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – Benefits

EVENT-DRIVEN SCALE SERVERLESS SUBSECOND BILLING

Page 4: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – Pricing

•  Requests •  $0.20 per 1 million requests •  First 1 million requests per month are FREE

•  Duration •  $0.00001667 for every GB-second used. •  Rounded up to the nearest 100ms •  400,000 GB-seconds of compute time per month are FREE

Page 5: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – How It Works

DEPLOYMENT

AUTHORING

MONITORING & LOGGING

STATELESS

Page 6: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda Function

•  Author your code •  Node.js, Java 8, Python 2.7, native libraries

•  Configure your runtime •  Handler •  Execution Role •  Resource Sizing – 128MB up to 1.5GB •  Timeout – 100ms up to 5min •  Networking – VPC / Public

•  Add event sources •  Configure API endpoint

Page 7: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda - Resource Sizing

•  AWS Lambda offers 23 “power levels” •  Higher levels offer more memory and more CPU power

•  128 MB, lowest CPU power •  1.5 GB, highest CPU power

•  Higher power levels == lower latency for CPU-bound and bursty tasks

•  Compute price scales with the power level •  Duration ranging from 100ms to 5 minutes

Page 8: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – Event Sources

Amazon S3 Amazon DynamoDB

Amazon Kinesis

AWS CloudTrail Amazon CloudWatch

Logs

AWS CloudFormation

Amazon SNS

AmazonSWF

AmazonSES

AmazonAPI Gateway

Amazon Cognito

November 13, 2014 Event Sources:

Integration with AWS Services:

AWS IoT

Page 9: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda – Partner Blueprints

Page 10: AWS Lambda and the Serverless Cloud -Pop-up Loft

In case you missed it…

Page 11: AWS Lambda and the Serverless Cloud -Pop-up Loft

New Feature: Scheduled Functions

Page 12: AWS Lambda and the Serverless Cloud -Pop-up Loft

Scheduled AWS Lambda Functions

•  Available today in the Lambda console •  Schedule functions at a specific time or recurring •  Accepts standard cron syntax •  5 minute granularity

•  You can get sub-second granularity using a Lambda function

•  Easily poll Amazon SQS or other data sources!

Page 13: AWS Lambda and the Serverless Cloud -Pop-up Loft

New Feature: Versioning

Page 14: AWS Lambda and the Serverless Cloud -Pop-up Loft

Versioning: Development

Developing in AWS Lambda stays simple: •  Upload code •  Make changes any time •  Last update wins

exports.handler = function(event,context) {context.succeed(“bye”);}

exports.handler = function(event,context) {context.succeed(“hi”);}

Page 15: AWS Lambda and the Serverless Cloud -Pop-up Loft

Versioning: Publishing

Publish new versions from development at any time: •  “Copies” dev version to a numbered version •  Published versions are read-only (including configuration) •  Simple, integer counter per function

exports.handler = function(event,context) {context.succeed(“bye”);}

exports.handler = function(event,context) {context.succeed(“hi”);} 1

2Versions

Page 16: AWS Lambda and the Serverless Cloud -Pop-up Loft

Versioning: Aliases

Create named aliases to any version: •  Allows function owner to map ARNs to code •  Can be updated without changing clients

exports.handler = function(event,context) {context.succeed(“bye”);}

exports.handler = function(event,context) {context.succeed(“hi”);} prod

dev Aliases

Page 17: AWS Lambda and the Serverless Cloud -Pop-up Loft

Versioning: Calling Lambda Functions

Development version: FunctionName (or) FunctionName:$LATEST

Specific version: FunctionName:1 FunctionName:2

Named version: FunctionName:production FunctionName:v1_2_3_4

Page 18: AWS Lambda and the Serverless Cloud -Pop-up Loft

Amazon API Gateway: Version your APIs

/prod/my_url_endpoint à

MyFunction:prod_rel

Versioning APIs and Code

MyFunction:prod_rel à

Function:3 à

{your code}

AWS Lambda: Version your code

Page 19: AWS Lambda and the Serverless Cloud -Pop-up Loft

New Feature: VPC Access

Page 20: AWS Lambda and the Serverless Cloud -Pop-up Loft

AWS Lambda VPC Access

•  Select the functions to run in your VPC •  Select subnets and security groups to use •  Your Lambda function can access the private resources

you choose: •  Amazon Elasticache •  Amazon RDS •  Private EC2 endpoints •  Any other resources in your VPC

Page 21: AWS Lambda and the Serverless Cloud -Pop-up Loft

Let’s get busy!

Page 22: AWS Lambda and the Serverless Cloud -Pop-up Loft

So what are we going to build today?

Voting Application

•  A voting application •  Fully serverless backend

•  Votes stored and aggregated on DynamoDB using Lambda

•  Static website on Amazon S3 and authentication using Cognito

•  Email voting using SES Inbound Rules integration with Lambda

Page 23: AWS Lambda and the Serverless Cloud -Pop-up Loft

So what are we doing to build today?

Page 24: AWS Lambda and the Serverless Cloud -Pop-up Loft

So what are we doing to build today?

Page 25: AWS Lambda and the Serverless Cloud -Pop-up Loft

So what are we doing to build today?

Page 26: AWS Lambda and the Serverless Cloud -Pop-up Loft

So what are we doing to build today?

Page 27: AWS Lambda and the Serverless Cloud -Pop-up Loft

Ran Tessler AWS Solu0ons Architecture Manager [email protected]