Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

A Walk in the Cloud with AWS Lambda

7,766 views

Published on

This presentation is from the AWS Lambda session of Container Days Conference in NYC. AWS Lambda is a new compute service that runs your code in response to events and automatically and dynamically manages infra resources for you. Tara will talk about AWS's event-driven compute strategy and explain how Lambda works to respond to events from various Amazon services.
Tara will describe what you need to easily build scalable microservices for mobile, web, and IoT applications that use AWS Lambda as a serverless back-end, how you can expose these services using Amazon API Gateway, and how to extend both AWS and third party services by triggering Lambda functions. She'll also cover the updated Lambda features announced at reInvent 2015, its programming model, and tips on getting the most out of Lambda.

Published in: Technology
  • Be the first to comment

A Walk in the Cloud with AWS Lambda

  1. 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Tara E. Walker Technical Evangelist Amazon Web Services An Introduction to AWS Lambda Serverless Cloud
  2. 2. AWS Compute offerings Lambda Serverless compute platform for stateless code execution in response to Triggers ECS Container management service for running Docker on a managed cluster of EC2 EC2 Virtual servers in the Cloud
  3. 3. AWS Lambda Overview 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!
  4. 4. AWS Lambda – Benefits EVENT-DRIVEN SCALESERVERLESS SUBSECOND BILLING
  5. 5. AWS Lambda – How It Works DEPLOYMENT AUTHORING MONITORING & LOGGING STATELESS
  6. 6. AWS Services Integrated with AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis November 13, 2014
  7. 7. AWS Services Integrated with AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS CloudTrail Amazon CloudWatch Logs AWS CloudFormation Amazon SNS Amazon SWF Amazon SES Amazon API Gateway Amazon Cognito
  8. 8. AWS Lambda – Partner Blueprints
  9. 9. Languages and Features re:Invent 2014 Preview Launch April 2015 GA Summer 2015 re:Invent 2015 • Node.js • Event handlers • CORS • Mobile Backends • Sync calls • Resource policies • Java • Amazon S3 uploads • Blueprints • 1.5 GB • Tokyo region • Alexa Skills • …and…
  10. 10. In case you missed it…
  11. 11. Amazon Simple Email Service Inbound Rules // Spam check if (sesNotification.receipt.spamVerdict.status === 'FAIL‘ || sesNotification.receipt.virusVerdict.status === 'FAIL') console.log('Dropping spam');
  12. 12. Amazon CloudWatch Logs Processing Scan, audit, or index log entries in near real time AWS LambdaAmazon CloudWatch Logs Amazon DynamoDB Amazon S3 Amazon Redshift
  13. 13. Lambda update: 5 new features announced earlier this month at re:Invent 2015 1. Python functions 2. Increased function duration 3. Function versioning & aliasing 4. Scheduled functions (Cron) 5. Accessing Resources in a VPC From a Lambda Function [coming soon] Details at: https://aws.amazon.com/blogs/aws/aws-lambda-update- python-vpc-increased-function-duration-scheduling-and-more/
  14. 14. New Feature: Python 2.7
  15. 15. Demo: Python 2.7 - Hello World
  16. 16. Python 2.7 Support in AWS Lambda • Available today in • All SDKs (including mobile SDKs) • AWS CLI • Lambda console (including interactive editing) • Includes • Version 1.1.3 of boto3 (AWS Python SDK) • Documentation and walkthroughs • Console blueprints
  17. 17. New Feature: Longer-running Functions
  18. 18. Longer-running AWS Lambda Functions • Run functions for up to 5 minutes • Available today in the following SDKs • Python (boto3) • Java • Node.js • PHP • AWS Mobile SDK for Android • AWS Mobile SDK for iOS
  19. 19. 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 • Free Tier: 1M free requests and 400,000 GB-s / month
  20. 20. New Feature: Scheduled Functions
  21. 21. Demo: Scheduled Function - Canary
  22. 22. 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! • Coming later in 2015: CLI, SDK support
  23. 23. New Feature: Versioning
  24. 24. 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”);}
  25. 25. 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 2 Versions
  26. 26. 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
  27. 27. 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
  28. 28. 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
  29. 29. New Feature: IoT Backends
  30. 30. AWS IoT + AWS Lambda
  31. 31. Sneak Peek: VPC Access
  32. 32. Sneak Peek: Accessing Resources in a VPC From a Lambda Function [Coming soon] Description: Access resources behind a VPC from inside Lambda functions Benefit: You will soon be able to access resources in a private IP range in your VPC, including EC2, ELB, RDS, ElastiCache and Redshift How it works: When creating Lambda functions, you will be able to select the VPC subnets and security groups, and the Lambda function executions can then access private endpoints in that VPC IP range
  33. 33. 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 • Launching later this year in all AWS Lambda regions
  34. 34. We’ve been busy. Now it’s your turn.
  35. 35. Go to the AWS Lambda console, create a function, and run it. (The first million invokes are on us!)
  36. 36. Congrats, you’re a Lambda function expert! Add an event source or an HTTP endpoint.
  37. 37. Build a mobile, voice, or IoT backend with a few lines of code.
  38. 38. Thank you! Follow me on Twitter @taraw Follow AWS Lambda! aws.amazon.com/blogs/compute aws.amazon.com/lambda AWS Lambda Forum

×