This document provides an overview and demos of AWS Lambda@Edge. It discusses how Lambda@Edge allows developers to run Node.js code at AWS edge locations to customize content delivery. Some key use cases include modifying requests and responses, URL rewriting, response generation from multiple origins, and adding security headers. The presentation includes demos of redirecting URLs, personalization, and A/B testing using Lambda@Edge.
4. 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
• Complex workflows with AWS Step Functions
• CloudFront requests
• And many more…
Makes it easy to:
• Perform real-time data processing
• Build scalable back-end services
• Glue and choreograph systems
5. Benefits of AWS Lambda
Continuous
scaling
No servers to
manage
Never pay for idle
– no cold servers
(only happy
accountants)
7. Amazon CloudFront Global Content Delivery Network
North America
Cities: 20, PoPs: 29
Ashburn, VA (3)
Atlanta, GA (3)
Bostong, MA
Chicago, IL
Dallas/Fort Worth, TX (2)
Hayward, CA
Jacksonville, FL
Los Angeles, CA (2)
Miami, FL
Minneapolis, MN
Montreal, QC
Newark, NJ
New York, NY (3)
Palo Alto, CA
Philadelphia, PA
San Jose, CA
Seattle, WA (3)
South Bend, IN
St. Louis, MO
Toronto, ON
Europe / Middle East / Africa
Cities: 15, PoPs: 24
Amsterdam, The Netherlands (2)
Berlin, Germany
Dublin, Ireland
Frankfurt, Germany (6)
London, England (4)
Madrid, Spain
Marseille, France
Milan, Italy
Munich, Germany
Paris, France (3)
Prague, Czech Republic
Stockholm, Sweden
Vienna, Austria
Warsaw, Poland
Zurich, Switzerland
95 CloudFront locations, incl. 84 CloudFront Edge Locations (PoPs) & 11 Regional Edge Caches
Edge Location
Region
Regional Edge Cache
Asia Pacific
Cities: 12, PoPs: 20
Chennai, India
Hong Kong, China (3)
Manila, the Philippines
Melbourne, Australia
Mumbai, India (2)
New Delhi, India
Osaka, Japan
Seoul, Korea (3)
Singapore (2)
Sydney, Australia
Taipei, Taiwan
Tokyo, Japan (4)
Regional Edge Caches
Regions: 11
Oregon
N. Virginia
Frankfurt
London
Sao Paulo
Mumbai
Singapore
Seoul
Tokyo
Sydney
South America
Cities: 2, PoPs: 3
Rio de Janeiro, Brazil (2)
São Paulo, Brazil
8. CloudFront Key Features
Accelerate static and dynamic content (websites, APIs)
Scalable and Global
Cache content closer to the user
Support HTTP/2 and IPv6
Highly secure
PCI DSS Level 1, ISO & HIPAA compliant
TLS (including HTTPS-only)
Amazon Certificate Manager
AWS Shield
AWS WAF
Self-service (Console, CLI, API, SDKs, CloudFormation)
Cost-efficient
11. 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 end user experience.
No servers
to manage
Continuous
scaling
Never pay for idle
– no cold servers
Globally
distributed
16. What Can Lambda@Edge Do?
Add/Remove/Modify request and response headers
Modify request URL path
Generate response
Access request info from response
17. Lambda compared to Lambda@Edge
Lambda Lambda@Edge
Languages Node.js, Python, C#, Java Node.js
Memory 128->1536MB 128MB
Execution time <300 seconds <3 seconds (Origin-facing)
<1 seconds (Viewer-facing)
Deployment size <50MB <1MB
Request pricing First 1 million free
$0.20 per 1 million
$0.60 per 1 million
Duration granularity 100ms 50ms
128MB for 100ms $0.000000208 $0.000000625
24. Usecases – A/B Testing
Test your theory on a proportion of users
Measure valuable metric (social likes/shares, engagement,
purchases, etc)
Implement findings