AWS Cloudfront Flashcards
What is a AWS CloudFront?
CloudFront is a CDN but has extra functionality for dynamic content, RTMP and security such as geo-restriction..
I need to mitigate DDOS attacks, is AWS CloudFront good mitigation and why?
Yes, it is because AWS CF has the ability to scale and AWS filters traffic the is not legit.
I have an API and I want to provide caching for this API and also get the benefit of improving global performance, what options do I have?
Use CloudFront as it has the ability to deal with caching dynamic content from an origin, this includes API. The way it works is you set the TTL to 0, CF will perform a head request with the origin to know if the content has changed, if not it will serve the cached content if the content has changed them CF will do a get.
What types of video stream can CF deal with?
On-demand
Pre-recorded
Live streaming
From a video streaming perspective, what is the advantage of using CF.
You push the streaming content need the edge and users.
How can I secure the content delivery by CloudFront?
- Signed URL’s
- Signed Cookies (Use Set_Cookie in request header)
I am using HSL with CF, can I use signed URLs?
No, signed URLs are only good for static content, HLS is mead up of chunks and the viewer app has to keep requestion new chunks ever say 5sec, use signed cookies is the correct method.
My company is using RTMP file and I want to make them available to users globally, what is my best option?
You can use s3 as the origin and CF to bring the content to the edge near the user, RTMP is supported for video streaming.
I have an s3 origin and I request with HTTP, what will the CF to S3 be?
It will be HTTP as when s3 is the origin, protocol is matched. HTTP = HTTP and HTTPs = HTTPs
I have an EC2 instance that accepts HTTP only, this is fronted by CF and the user requests HTTPS, what will happen?
Id HTTP only option on CF is set up the request will be sent to the origin as HTTP.
I would like to server content for several origins, is this possible with CF?
Yes CF supports multiple origins.
Can I have an on-prem as an origin for Cloudfront?
yes, you can point CF anywhere.
can I invalidate CDN cache object or even everything?
Yes
can I use my own SSL?
yes
can I have custom error images?
yes?
what HTTP methods are cached?
get
head
options
For dynamic CF content, what does TTL 0 do?
If set to 0, CF will send a head request to see if anything in the content has changed, if it has then CF does a GET and stores the content.
We want people from all around the world to upload files to our EC2 instances?
Use CF as it will allow upload and will send to EC2 over AWS backbone.
Can we have CF send us to different origins based on the calling device?
Yes
I have an S3 bucket that I want to use with CF to distribute the file, but I do not what users to be able to access directly with s3, what options do I have with CF?
Use origin access identity, this ensures CF is able to access the bucket.
What is a multi-region CF origin design?
This is where we have multiple regions act as a origin for CloudFront.
Can I use DNS names with CF?
Yes, you cna have CF look up any domain and where you use Route53, I can then have Route53 deliver based on latency-based routing.
I want to use latency based routing with CF, what are my options.
You can point your CF CDN at route53 zone with latency based routing set up.
With regard to cloudfront, what are the network benefits?
It reduces the number of hops
I need to stream RTMP, what is my best option?
As S3 is the only supported origin for RTMP and, put the file in S3 and front with CF.
I have to increase the security of information passing through cloudfront, I would like to encrypt fields in my data, is this possible?
Ye 100%, field level encryption is a feature of CF.
I require the ability to encrypt fields send for processing of card payment transactions through CF to the origin, what options do I have?
We can use the encrypt fields feature of CloudFront, this will encrypt the field data sent through CF. You specify the set of fields in the post you want to encrypt.
How many fields can I encrypt use field encryption with Cloudfront?
Up to 10.
How cna I make more requests hit the cache?
Increase the TTL, forcing.
How can we invalidate cached files without using invalidate to the caching server?
invalidate by using a different file name or a GUID attached tot he files name, this way the client is forced to go back and get the new file. You would update the file by generating a new name,
What would happen if I added Cache-Control max-age to my origin?
It would set the max time available where the client would not come back to the CDN and Origan for a file until the max time was reached. This would help with the number of hits the organ is taking.
How can I improve the hit ratio on the CDN?
- Cache-Control max-age
- Query string based caching
- Caching based on cookies
I have a web application that received a query string through CF, the query string is for each language. I would like CF to cache each language page separately, what options do I have?
You cna use query string based caching to have CF cache ech seperta languate gage.
What is query string based caching?
It enables you to have CF use the query string to cache sperate respon ces form the origan such as language file and then the next time the same querystring is used the casche will serve the content/file.
Need to be able to clock certan counteries from accessing content, what options do i have for CF?
Using Geo Restrictions you can blcok cenrtan counteries.
With S3 I need ot be able to block certan counteries from accessing content, what options do I have?
You cna add CF to the soliution and have CF blck certan GEOS.
What is a CloudFront Distribution?
It is the entity that contains the information for,
- Origin or origin groups
- Behaviours
- Error pages
- Restrictions
- Invalidation
- Tags
What type of streaming media is supported by CloudFront?
RTMP, but you can also distribute media files over HTTP and HTPPs
I have a set of a media file and I wnat to distribute them globally and want to have my user fast access to them, what can I do?
You cna use CF to distribute the files.
We are live streaming contents using HTTP and HTTPS in, I wnat to distribute this globally, what are my options?
You cna use CloudFront.
I am using RTMP and I wnat to use CloudFront, can I use my on-prem origin?
No, you have to use S3
What is a CloudFront distribution?
It is an entity that describes the functions and properties that apply to your instance of the CloudFront service.
What origins dose CloudFront support?
- s3
- EC2
- On-prem (any public endpoint with compatible content)
For CloudFront what type of distributions are supported?
- Web: static content, HTTP and HTTPS medial files, Update and delete objects and live to stream.
- RTMP
I am using RTMP, I wnat to store my file on-prem, how cna I configure this?
You can RTMP only supports s3.
What is the content origin?
It is where the data/file is living or coming from.
What is an Origin fetch?
This is where CloudFront fetches the content from the origin.
What is the viewer protocol?
This is the client protocol that is making requests to AWS?
What is the Origin protocol?
This is the protocol used to connect with the origin during and origin fetch?
I wnat to restrict access to the bucket and force people To access content through the CloudFront, how can do this?
CloudFront has a setting, you cna also set up an s3 policy on the s3 bucket to restrict any request to CloudFront.
What option do I have when the connecting to an Origin form CloudFront?
These are for other origins and, not s3.
- TLS v1.2, 1.1, 1
- HTTP and HTTPs, Match viewer
- Response time out
- HTTP Port
- HTPS Port
What viewer protocol setting can I have?
- HTTP + HTTPs
- Restrict HTTP to HTTPs
- HTTPs only.
- Restrict HTTP type requests like GET, HEAD, GET HEAD OPTIONS, all HEET requests.
What are the encrypted fields?
This is where you get to select an option for your distribution that encrypts all the fields in your request, do data is encrypted all the way to the origin.
For pricing on CloudFront, what are the options I have?
- US, Canada, Europe
- US, Canada, Europe and Afarica
- All locations.
I wnat to add a WAF to my CloudFront is this possible?
Yes
I am using CloudFront as a caching layer for my content and also as a gateway for my API, I am getting SQL injection attacks and would like to stop them, what options do I have?
Put a WAF in front of the CloudFront distribution.
What is Server Name Indication (SNI)?
It is a TLS feature that enables a host to say what host it wnat to connect with, this is so when the host connects to an LB or CDN the LB or CDN can return the correct cert.
For CloudFront, where do I get the cert form?
ACM
What is the order the CloudFront cache is checked?
Edge (local) cache and then regional cache and then the origin.
What is the Lambda edge used for?
It can be used to alter the request coming in or the response going back form CloudFront.
Can I geo restrict CloudFront?
Yes in your distribution you have the ability to create a geo whitelist of countries you wnat to allow.
What TLS version should you use for CloudFront?
TLSv1.1_2016
I have two origins, one for jpgs and the other for MPEGs, how cna I configure CloudFront distribute both origins content?
Set up distribution with two behaviours pointing to the two origins. One behaviour with a path pattern of images/.jpg and the other origin of /video/.mpg