CloudFront & AWS Global Accelerator Flashcards
What is CloudFront?
It is a CDN - Content Delivery Network
CloudFront (CDN) benefits
Improves read performance, content is cached at the edge
Improves user experience
What form of protection does CloudFront have?
Against DDoS (because world wide)
Integration with Shield, AWS Web Application Firewall
What is CloudFront Origins for S3?
Distributing files and caching them at the edge
Enhanced Security with CloudFront Origin Access Control
CloudFront can be used as an Ingress (upload files to S3)
What is CloudFront Custom origin (HTTP)
You can have the benefits of CloudFront Origins for services that use HTTP (caching distributed files at edge)
ALB
EC2 instance
S3 website (static website)
Any HTTP backend you want
CloudFront High Level (architecture)
Client sends GET /beach.jpg to CloudFront Edge Location.
IF it is NOT cached, then it forwards the request to the Origin (which has S3 or HTTP).
Then it Adds the requested objects from the Origin location into the Local Cache for the next time it gets requested.
Example for S3 as an Origin
Users will get data from the public internet at the Edge location. The Edge location would have gotten that data from the Origin (S3 bucket) which is also protected by Origin Access Control + S3 bucket policy
CloudFront vs S3 Cross Region Replication
CloudFront
global edge network
files are cached for a TTL (maybe a day)
Great for static content that must be available everywhere
S3 Cross Region Replication
Must be setup for each region you want replication to happen
files updated in near real-time
read only
great for dynamic content that needs to be available at low-latency in few regions
CloudFront ALB as an Origin
Users make requests to edge location public IP. Then edge location makes the request to the ALB which must be public and its sec group must allow edge location IPs.
Then the ALB will send the requests to the EC2 Instances which can be private, and their SG must allow access to the ALB’s Security Group
CloudFront EC2 as an Origin
Users send requests to edge location, then edge location sends request to the Security Group of the EC2 instances which must be public. The SG must allow the public IP of edge location
CloudFront GeoRestriction
Allowlist - define list of approved countries
Blocklist - define list of banned countries
Use case for CloudFront GeoRestriction
Country is determined using 3rd party Geo-IP database.
Use cases are copyright laws to control access to content
CloudFront Pricing
Cost is lower the higher the transfer data size/amount is.
Price also depends on location
How many price classes does CloudFront have?
3
Price Class All (cloudfront)
All regions - best performance