Cloudfront Flashcards

1
Q

What is AWS Cloudfront and what is its purpose?

A

It is a CDN that improves read performance by catching content at the ‘edge’

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

What protection does CloudFront provide?

A

DDoS Protection

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

What are the 3 different CloudFront origins?

A
  1. S3 bucket - Uploading/downloading files
  2. VPC - Load balancers/EC2 instances
  3. Custom Origin (HTTP) - Public IP’s
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Compare CloudFront vs S3 Cross Region Replication

A

Cloudfront uses the Global Edge network where files are cached for a TLL. This is good for static content that must be available everywhere.

S3 Cross Region Replication must be setup for each region but is good for dynamic contentt htat needs to be available at low latency in a few regions.

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

What API can be used to invalidate part of a CloudFront cache?

A

CreateInvalidation API

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

What is a CloudFront cache key and what is its default value?

A

It is a unique identifier for an object in the cache and by default is the hostname + the resource portion of the URL

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

How can you enable a custom Cache Key and what can the cache be based on?

A

Using CloudFront Cache Policies you can cache based on
1. HTTP Headers
2. Cookies
3. Query Strings

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

When making a request to CloudFront, what will be automatically included in origin requests?

A

HTTP headers, cookies, and query strings

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

How could you specify values to include in origins requests without including them in the Cache Key?

A

Using Origin Request Policies (either predefined managed or custom)

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

When performing a cache invalidation, what are two ways you can select which files to invalidate?

A
  1. All files using *
  2. Specific paths ‘/’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the default cache behaviour and when will it be processed?

A

It is /* and it will always be processed last

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

Describe how Cache Behaviours can be used to enforce authentication?

A

You could connect /login to connect to a downstream ec2 instance that generates signed cookies. Then when navigating to other paths, another cache behaviour could allow/deny based on those signed cookies.

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

What feature can be used to delivery content from a private subnet via cloudfront?

A

Using a VPC origin

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

How can you control access to CloudFront based on to the end users country

A

Geographic restrictions (allow/block lists)

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

Suppose you want to limit access to a resource via CloudFront, what 2 things could you generate?

A

A signed URL - Single File
A signed Cookie - Multiple Files

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

Compare CloudFront signed URLs to S3 presigned URLs. When should you use each?

A

CloudFront Signed URL
- Allow access to a path, no matter the origin
- Good for when you want to use caching features

S3 Presigned URL
- Allows for issuing a request as the person who presigned the url
- Limited lifetime

17
Q

What are the two signers for CloudFront signed URLs? Why is one recommended over the other?

A
  1. Trusted Key Group - Preffered as IAM can be used and API can create/rotate keys
  2. Account with CloudFront Key Pair - Not recommended as requires root account
18
Q

How many price classes are there for CloudFront?

A

There are 3 [All, 200, 100]

19
Q

How could you improve your service availablity with CloudFront?

A

Use two origin groups, with one failing over to the other incase any issue occurs

20
Q

When using Field Level Encryption, where is the data encrypted and decrypted?

A

Encrypted using Public Key on Edge Location
Decrypted using Private Key on Web Server