This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Shubham Katiyar, AWS, Sr. Software Development Manager
Daniel Amitai, VP Business Development, Cloudinary.com
December 1, 2016
NEW LAUNCH!
Bringing AWS Lambda to the Edge (Lambda@Edge Preview)
CTD206
What to Expect from the Session
• Background on AWS Lambda and Amazon CloudFront
• Lambda@Edge: How it works, and when to use it
• Demo of Lambda@Edge
• Customer Case Study: Cloudinary
• Getting started with Lambda@Edge (Preview)
AWS Lambda: Evolution of
Cloud Compute towards
Serverless
Evolution of Compute – Public Cloud
InfrastructureInstances
Application code
Evolution of Compute – Containers
InfrastructureInstances
Application codeContainers
Evolution of Compute – Serverless
Application code
AWS Lambda: Serverless computing
Run code without servers. Pay only for the compute time you consume. Be happy.
Triggered by events or called from APIs:• PUT to an Amazon S3 bucket
• Updates to Amazon DynamoDB table
• Call to an Amazon API Gateway endpoint
• Mobile app back-end call
• CloudFront requests
• And many more…
Makes it easy to:
• Perform real-time data processing
• Build scalable back-end services
• Glue and choreograph systems
Benefits of AWS Lambda
Continuous
scaling
No servers to
manage
Never pay for idle
– no cold servers
(only happy
accountants)
…but all triggered from within
a single AWS region
Edge: AWS global network of
Points of Presence (POPs) on the
backbone of the Internet –
Amazon CloudFront
CloudFront: Global Content Delivery Network
Accelerate your application and APIs
Including static content such as images and video
Massively scalable
Highly secure
Self-service
Priced to minimize cost
Dynamic
StaticVideo
User
Input
SSL
CloudFront delivers ALL types of content
Without changing your back end…
ALB / ELB
Dynamic Content
Amazon EC2
Static Content
Amazon S3 Custom Origin
OR
OR
Custom OriginAmazon CloudFront
example.com
*.jpg
*.php
Imagine if you could run code at…
North America South America EMEA APAC
POPs
Cities Countries Continents
Regional Edge Caches
Putting it together: Lambda@Edge
Introducing Lambda@Edge
• Lambda@Edge is an extension of AWS Lambda that allows you to run
Node.js code at AWS global edge locations.
• Bring your own code to the edge and customize your content very close to
your users, improving the end-user experience.
Continuous
scaling No servers
to manage
Never pay for idle
– no cold serversGlobally
distributed
Write once, run everywhere
Current State of the World
CloudFront Triggers for Lambda@Edge
Functions
CloudFront Triggers for
Lambda@Edge Functions
What can Lambda@Edge do?
• User Properties – Identify a user’s location or what device they are using to select content accordingly (e.g., smaller images for mobile vs. desktop, selecting page language based on location)
• Client Device properties - Delete or modify headers to match protocols required by legacy end user devices
• Legacy TVs, networked printers
Content Customization
Visitor Validation
• Handing bots• Detect search engine bots and filter this
traffic from origin servers by displaying a
Captcha page
• Confirm valid sessions• View user-agent to confirm legitimacy of