

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
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
You just learned how to create presigned URLs, but you might be wondering: why go through all this trouble? Well, imagine you're building a course platform where students can download PDFs of their course materials. If you make the PDFs public in S3 then all the content would be accessible for free!
...and unless you're as cool as Boot.dev, you probably don't want that.
This is where presigned URLs shine. Instead of making your S3 bucket or CloudFront content publicly accessible, you can use presigned URLs to get the best of both worlds: CDN speed with a private-content access control. You dish out presigned URLs to paying users, they download the content before the URL expires, and once it does, their URL becomes useless. By setting extremely short expiry times, and generating a new URL when a paying user requests it, they can effectively keep access forever, but will only be able to get the content if they're going through your link generator.
Cost check: Presigned URL generation is free. You still pay for S3 and CloudFront when users access content via the URL; no extra charge for the URL itself.
Presigned URLs are perfect for:
We share a lot of image files for one of our clients, but we'd really prefer not to be their "free CDN" service. So we've started sending them with presigned URLs so they're forced to store the files on their end if they want to serve them to their users.