

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: CloudFront CDN
incomplete
2: CloudFront Distributions
incomplete
3: CloudFront Invalidation
incomplete
4: Presigned URLs
incomplete
5: Why Use Presigned URLs?
incomplete
6: CloudFront With DNS
incomplete
7: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A CloudFront distribution is the configuration that tells CloudFront:
When you create a distribution, CloudFront assigns it a domain name, like d1234567890.cloudfront.net, which you can use to access your content through the CDN.
index.html)CDNs are typically used to serve static content, like images, videos, and documents. You may have heard of Lambda@Edge for actual computational request/response logic close to users... more on that later.
Right now, your favicon is sitting in an S3 bucket. Users can access it, but they're hitting S3 directly, which means:
A CloudFront distribution solves this by creating a network that caches your content at edge locations worldwide. Users get faster access, and you reduce load on S3.
Create a CloudFront distribution that points to your S3 bucket. This will make the favicon accessible through CloudFront's global edge network.
Cost check: CloudFront data transfer costs vary by region and volume. The first 1 TB per month is free, then it's roughly $0.085 per GB.
Some new AWS accounts must be verified before they can create CloudFront resources. If AWS says your account must be verified before adding CloudFront resources, contact AWS Support and include that error message.
Run and submit the CLI tests.
If you prefer to use the CLI, here's a command structure to get started with CloudFront distributions:
aws cloudfront create-distribution --distribution-config '{"CallerReference":"<unique-string>","Origins":{"Quantity":1,"Items":[{"Id":"<origin-id>","DomainName":"<bucket-domain>","S3OriginConfig":{"OriginAccessIdentity":""}}]},"DefaultCacheBehavior":{"TargetOriginId":"<origin-id>","ViewerProtocolPolicy":"redirect-to-https","AllowedMethods":{"Quantity":2,"Items":["GET","HEAD"]},"CachePolicyId":"<cache-policy-id>"},"Enabled":true}'