サービス · Networking and Content Delivery · CLF-C02 の発展
Amazon CloudFront
A CDN with cache rules, private S3 origins, origin failover, signed access and code at the edge.
このレッスンはまだ翻訳されていないため、英語で表示しています。
クラウドプラクティショナーで学んだこと
- CloudFront caches content in edge locations near users.
- The origin can be S3, a load balancer, EC2 or a server outside AWS.
- It works with AWS Shield, AWS WAF and ACM.
Keep S3 private
- Origin access control
One private file
- Signed URL
Many private files
- Signed cookies
Block countries
- Geographic restriction
Protect form fields
- Field-level encryption
Tiny edge logic
- CloudFront Functions
Heavy edge logic
- Lambda@Edge
| Need | Use |
|---|---|
| Keep S3 private | Origin access control |
| One private file | Signed URL |
| Many private files | Signed cookies |
| Block countries | Geographic restriction |
| Protect form fields | Field-level encryption |
| Tiny edge logic | CloudFront Functions |
| Heavy edge logic | Lambda@Edge |
1 / 2
Keep S3 private
- Origin access control
One private file
- Signed URL
Many private files
- Signed cookies
Block countries
- Geographic restriction
| Need | Use |
|---|---|
| Keep S3 private | Origin access control |
| One private file | Signed URL |
| Many private files | Signed cookies |
| Block countries | Geographic restriction |
2 / 2
Protect form fields
- Field-level encryption
Tiny edge logic
- CloudFront Functions
Heavy edge logic
- Lambda@Edge
| Need | Use |
|---|---|
| Protect form fields | Field-level encryption |
| Tiny edge logic | CloudFront Functions |
| Heavy edge logic | Lambda@Edge |
概要
A cache behavior maps a path pattern, such as /images/*, to an origin and to cache rules, including how long content stays cached (TTL). To change content early you can invalidate paths, but each invalidation takes time and can cost money. Putting a version in the file name is the better habit. For S3 origins, use origin access control (OAC), so the bucket stays private and only CloudFront can read it.
概要
An origin group gives failover: if the primary origin returns an error, CloudFront tries the secondary origin. To restrict content, use signed URLs for single files or signed cookies for many files, geographic restrictions to allow or block countries, and field-level encryption to protect sensitive form fields at the edge. To run code, CloudFront Functions suit short JavaScript tasks such as redirects and header changes. Lambda@Edge suits longer tasks that need network access.
覚えること
- Cache behavior: path pattern, origin, TTL and cache rules.
- OAC keeps an S3 bucket private. Origin groups fail over to a second origin.
- Signed URLs: one file. Signed cookies: many files.
- Geographic restrictions allow or block countries. Field-level encryption protects chosen form fields.
覚えること
- CloudFront Functions: JavaScript, under a millisecond, viewer events only, no network access.
- Lambda@Edge: Node.js or Python, can use the network, runs on all four events.
試験では
- “Serve private S3 content only through CloudFront” points to origin access control.
- “Paid content for subscribers, many files” points to signed cookies. One file points to a signed URL.
- “Simple header rewrite at massive scale, lowest cost” points to CloudFront Functions.
- “Fail over when the origin is down” points to an origin group.
混同しやすいもの
AWS Global AcceleratorTwo static anycast IP addresses and the AWS network for TCP and UDP traffic, with fast Regional failover.
- Edge locationsSites close to users where CloudFront, Route 53, Global Accelerator and Shield answer requests.
Amazon Route 53Pick the routing policy that matches the clue, alias records, the three kinds of health check, and private DNS.