More Related Content Similar to Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 2018 (20) More from Amazon Web Services (20) Customizing Content Delivery with Lambda@Edge (CTD415-R1) - AWS re:Invent 20182. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Customizing Content Delivery
with Lambda@Edge
C T D 4 1 5
Acar Erkek
Software Dev Engineer
Amazon Web Services
Alexander Korobeynikov
Software Dev Engineer
Amazon Web Services
github.com/aws-samples/aws-
lambda-edge-workshops
Now!
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What to expect
• Brief presentation (~15min)
• Global serverless computing with AWS Lambda@Edge
• Overview of the workshop labs
• Meet the aliens. Time to build! (~90min)
• Workshop cost? Less than $0.5. Free tier applies.
AWS Credits worth of $25 at the end
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Launch the AWS CloudFormation stack
https://github.com/aws-samples/aws-lambda-edge-workshops
Google: aws lambda edge workshop
5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Locations: Where is Your Customer?
150 Points of
Presence
65 cities
29 countries
18 AWS
Regions
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda: Why Serverless?
Build and run applications without managing servers
• No servers to manage
• Run at scale
• Respond quickly to events
• Only pay for compute time that you use
• Developer productivity
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon CloudFront: Global Content Delivery
• Global, growing content delivery network
• High performance—speed up distribution of your static and
dynamic web content to your users across the world
• DDoS resiliency, scale, and cost effective
• Flexible and highly “programmable” with
AWS Lambda@Edge
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Global Serverless:
Run Lambda Functions Across AWS Locations
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of AWS Lambda@Edge
Continuous
scaling
No servers
to manage
Never pay
for idle
Global presence
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Programmable CloudFront; Lambda@Edge
User Agents Origin
Viewer
Response
Viewer
Request
Origin
Request
Origin
Response
CloudFront
Cache
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What Can You Do With Lambda@Edge?
High performance
Extend your apps to
AWS locations globally
No servers to manage
Simpler origin
Serverless
Program your CDN
Deliver personalized
experiences
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Meet the Un-Canny
Aliens have arrived, and established their bases over major
metropolitan areas across the Earth. After several failed
attempts of peaceful dialogue, we realized—we just can’t
communicate.
Humans and Aliens do not share a common language!
This is our last attempt, and world leaders are looking up to
you to deliver a high performance, highly available, and
serverless platform for Humans and Aliens to communicate
through —
Alien Connect!
Alien Cards (Kindergarten cards, but for Aliens) might be the
last chance for humanity… and it rests on your shoulders!
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Alien Connect — the Serverless Stack
AWS
Lambda@Edge
Amazon
S3
Amazon
DynamoDB
Amazon
CloudFront
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
#1 Enhance Security:
Secure your Alien Cards
Objective: let's check and improve your website security by configuring HTTP to HTTPs redirect and adding a
number of standard security headers to enforce HTTPS connection is always used and prevent XSS.
https://observatory.mozilla.org
Security Headers:
• Strict-Transport-Security
• Content-Security-Policy
• X-XSS-Protection
• X-Content-Type-Options
• X-Frame-Options
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
#2 Generate Content:
View your Alien Cards, and Homepage
Objective: in this lab, you will enhance the look and feel of your web-site by using Lambda@Edge function
that dynamically generates HTML content that can be cached by CloudFront and returned back to your
viewers
Alien Card DetailsHomepage
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
#3 Simple API:
Like Your Alien Cards
Objective: in this lab, you will enhance the look and feel of your web-site by using Lambda@Edge function
that dynamically generates HTML content that can be cached by CloudFront and returned back to your
viewers
POST /api/like?id=<card_id>
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
#4 Pretty URL:
Share Your Alien Cards
Objective: Objective: Make your URLs easy to remember and share
Before: https://d3rugkzdgfe4op.cloudfront.net/card/da8398f4
After: https://d3rugkzdgfe4op.cloudfront.net/tree
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
#5 Optimize Content:
Optimize your Alien Homepage for the device type
Objective: Optimize look and feel depending on the viewer device type
Desktop Device Mobile Device
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Break into small groups or do it individually
• Launch CloudFormation stack
• Raise a hand if you have a question
or need help
• Share/Tweet as you build
#reinvent #lambda@edge
https://github.com/aws-samples/aws-lambda-edge-workshops
23. Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Acar Erkek
Alexander Korobeynikov
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.