Cloudfront Flashcards

1
Q

AWS Cloudfront

A

CDN - content delivery network
DDoS protection, WAF, etc.

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

CF origins

A
  • S3 buckets - distribute files and cache them at the edge
    • enhanced security with origin access identity (OAI)
    • iam role for cloudfront origin
  • cloudfront used as an ingress to upload to S3
  • Custom Origin (HTTP)
    • ALB, ec2, s3 website
      • ec2 instances MUST be public (if no ALB)
      • security group must allow public IPs of edge location
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Cloudfront vs cross region replication

A
  • cloudfront good for static content to be displayed around the world
  • s3 cross region replication must be setup for each region, near real time updates, read only, good for dynamic content
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Cloudfront caching

A
  • cache based on headers, cookies, query string parameters
  • cache lives at each edge location
  • invalidate part of the cache using the api
  • good to use separate cache for dynamic and static content
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cloudfront Security

A
  • http to https redirect, or https only - viewer protocol policy
  • origin protocol policy
    • https only or match viewer (http → http / https → https)
    • s3 bucket websites only support http
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Cloudfront signed urls / cookies

A
  • signed url - access to individual files (think PAID content)
    • signers
      • trusted key group (recommended)
        • create private/public RSA key, public is uploaded to CF, private is used by app
      • an aws account that contains a cloudfront key pair
        • requires root account credentials (not recommended)
  • cookies - reusable, many files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

cloudfront signed url vs s3 pre signed url

A
  • cloudfront- allow access to a path no matter origin, account wide
  • s3 pre-signed - issue a request as the person who pre-signed the url
    • limited lifetime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

cloudfront key pairs

A

only root account can create them in the aws console
you can have only up to two active key pairs per account

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

cloudfront key groups

A

Whereas, with CloudFront key groups, you can associate a higher number of public keys with your CloudFront distribution, giving you more flexibility in how you use and manage the public keys. By default, you can associate up to four key groups with a single distribution, and you can have up to five public keys in a key group.

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

cloudfront parameter types

A

String – A literal string
Number – An integer or float
List<Number> – An array of integers or floats
CommaDelimitedList – An array of literal strings that are separated by commas
AWS::EC2::KeyPair::KeyName – An Amazon EC2 key pair name
AWS::EC2::SecurityGroup::Id – A security group ID
AWS::EC2::Subnet::Id – A subnet ID
AWS::EC2::VPC::Id – A VPC ID
List<AWS::EC2::VPC::Id> – An array of VPC IDs
List<AWS::EC2::SecurityGroup::Id> – An array of security group IDs
List<AWS::EC2::Subnet::Id> – An array of subnet IDs</Number>

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

Cloudfront origin groups / failover

A

CloudFront routes all incoming requests to the primary origin, even when a previous request failed over to the secondary origin. CloudFront only sends requests to the secondary origin after a request to the primary origin fails.

only one primary origin

CloudFront fails over to the secondary origin only when the HTTP method of the viewer request is GET, HEAD, or OPTIONS. CloudFront does not failover when the viewer sends a different HTTP method (for example POST, PUT, and so on).

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