Cloudfront Flashcards

1
Q

What is Amazon Cloudfront?

A

It is a Content Delivery Network (CDN). Improves read performance, content is cached at the edge.
DDos protection, integration with Shield, AWS Web Application Firewall

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What can be the Origin for Cloudfront?

A
  • S3 bucket
  • ALB
  • EC2 instance
  • S3 website
  • Any HTTP backend
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the enhanched security between Cloudfront and S3?

A

THe Origin Access Control (OAC)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe Cloudfront az a high level.

A

Client requests a resource (GET /beach.jpg), then Cloudfront edge location checking if its in the local cache. If its there returns it, otherwise it will fetch from the server (origin)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between Cloudfront and S3 Cross Region Replicas?

A

Cf:
* Global Edge network
* Files are cached for a TTL
* Great for static content that must be available everywhere

S3:
* Must setup for each region you want repplication
* Files are updated in near real-time
* Read only
* Great for dynamic content that needs to be available at low-latency in few regions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe Cloudfront caching.

A
  • The cache lives at each CloudFront Edge Location
  • CloudFront identifies each object in the cache using the Cache Key
  • You want to maximize the Cache Hit ratio to minimize requests to the origin
  • You can invalidate part of the cache using the CreateInvalidation API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is CloudFront Cache Key?

A
  • A unique identifier for every object in the cache
  • By default, consists of hostname + resource portion of the URL
  • You can add other elements (HTTP headers, cookies, query strings) to the Cache Key using CloudFront Cache Policies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List the different configurations for the Cloudfront Cache Policies.

A

Cache is based on
* HTTP Headers: None – Whitelist
* Cookies: None – Whitelist – Include All-Except – All
* Query Strings: None – Whitelist – Include All-Except – All

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can you control the TTL in Cloudfront cache policies?

A

Can be set by the origin using the Cache-Control header and Expires header.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is sent to the origin if you applied Cloudfront Cache Policies?

A

All HTTP headers, cookies, and query strings that you include in the Cache Key are automatically included in origin requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Cloudfront Origin Request Policy?

A

Specify values that you want to include in origin requests without including them in the Cache Key (no duplicated cached content).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What can you include in Cloudfront Origin Request Policy?

A
  • HTTP headers: None – Whitelist – All viewer headers options
  • Cookies: None – Whitelist – All
  • Query Strings: None – Whitelist – All
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Whats Cloudfront Cache Invalidations?

A

You can force an entire or partial cache refresh (thus bypassing the TTL) by performing a CloudFront Invalidation.
You can invalidate all files () or a special path (/images/).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are Cloudfront Cache Behaviors?

A

Configure different settings for a given URL path pattern
* Use case: Route to different kind of origins/origin groups based on the content type or path pattern
* Default Cache Behavior is always the last to be processed and is always /

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Whats a must if your Cloudfront distribution points to an EC2 instace?

A
  • The instance must be public
  • You have to allow ALL public IP of the edge locations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Whats a must if your Cloudfront distribution points a front ALB before EC2 instance?

A
  • ALB must be public -> EC2 can be private
  • ALB must enable public IP’s of edge locations
17
Q

What is Cloudfront Geo Restriction?

A

You can restrict who can access your distribution:
* Allowlist: Allow your users to access your content only if they’re in one of the
countries on a list of approved countries.
* Blocklist: Prevent your users from accessing your content if they’re in one of the
countries on a list of banned countries

Country determined by a 3rd party

18
Q

What are Cloudfront Signed Url / Signed Cookies?

A

Give access to content is Cloudfront. Can attach a policy to it:
* Url expiration
* IP ranges to access data
* Trusted signers

19
Q

Whats the difference between Cloudfront Signed Url vs Signed Cookies?

A
  • Signed URL = access to individual files (one signed URL per file)
  • Signed Cookies = access to multiple files (one signed cookie for many files)
20
Q

Describe the difference between CloudFront Signed URL vs S3 Pre-Signed URL?

A

CloudFront Signed URL:
* Allow access to a path, no matter the origin
* Account wide key-pair, only the root can manage it
* Can filter by IP, path, date, expiration
* Can leverage caching features

S3 Pre-Signed URL:
* Issue a request as the person who pre-signed the URL
* Uses the IAM key of the signing IAM principal
* Limited lifetime

21
Q

Whats the best way for CloudFront Signed URL Process?

A

Create a trusted key group.

22
Q

What are the 3 price classes for Cloudfront?

A
  1. Price Class All: all regions – best performance
  2. Price Class 200: most regions, but excludes the most expensive regions (100 + Asia, Africa)
  3. Price Class 100: only the least expensive regions (USA, EU)
23
Q

What is Cloudfront Multiple Origin?

A

To route to different kind of origins based on the content type.

24
Q

What are Cloudfront Origin Groups?

A
  • To increase high-availability and do failover
  • Origin Group: one primary and one secondary origin
  • If the primary origin fails, the second one is used
25
Q

What is Cloudfront Field level encryption?

A
  • Sensitive information encrypted at the edge close to user
  • Uses asymmetric encryption
  • Usage:
  • Specify set of fields in POST requests that you want to be encrypted (up to 10 fields)
  • Specify the public key to encrypt them