CloudFront Flashcards
You have a lambda function which you need to deliver globally. Latency is an issue and needs to be minimised. What would a solution be and where and how would processing occurr?
Lambda@edge would be a solution. You can create your function in python or node.js in lambda and configure it respond to a cloudwatch event. When a request is made, the function is propagated to cloudfront. Processing then occurs at the edge
You have an S3 bucket with content being served from Cloudfront. When a batch of new content is added you need to ensure that the CF cache is updated. What is the AWS recommended way of achieving this?
Enabling version in CloudFront by specifically versioning filenames or directory names. CF will pick up on the changes and serve the new objects.
What is the default TTL for cloudfront cached objects (in hours)?
24hrs
For CloudFront custom origin what protocol is used to expose the end point?
HTTP is used to expose an custom origin endpoint to CloudFront
What are the two origin types that can be used for CloudFront?
S3 and Custom Origin (HTTP)
Can you use an ALB or EC2 instance as a custom origin for CloudFront?
Yes, via HTTP endpoints
I am building a web application which has content stored on S3 and a global user base. The content is static and consists mainly of style sheets, corporate logos and the like. I need to ensure that when a user accesses the site, these resources (some of which are large) are served from a location closest to the user. Would I be best to use S3 cross region replication or CloudFront to achieve this and Why?
If the content is static and must be available globally, then CloudFront is the best choice. CloudFront has a TTL of 24 hours by default for cached objects and makes use of the global edge network for content delivery. S3 cross region replication is best when we only need to serve content to a few regions and that content is highly dynamic as content is updated in near real time and is available at low latency.
I am intending to use an EC2 instance as a custom origin for CloudFront. To allow the edge location in CloudFront to access this instance should the instance be public or private and what would the security group look like?
The instance needs to be public for the edge location to access it (i.e from the web). The security group however will restrict inbound access to IP’s associated with the Edge Locations
While CloudFront provides CDN capability, what two security capabilities does it also provide?
CloudFront also provides DDOS protection and Web Application Firewall (WAF) capability
I have a group of EC2 instances deployed behind an application load balancer that I want to use as a custom origin for CloudFront. Will the ALB need to be exposed publicly, what will its security group look like AND will the EC2 instances be public or private and what will their security group look like?
The ALB will need to be public. Its security group will restrict inbound traffic to the AWS Edge locations. The EC2 instances will be private with inbound traffic restricted to the ALB security group.
Can CloudFront be used to restrict content based on a users geographic location?
Yes. CloudFront supports whitelisting and blacklisting of countries.
You have created a CloudFront Distribution against an S3 bucket. The S3 bucket is secured using an Object Access Identity. When you try to retrieve content using the CloudFront URL, you see a redirect to an S3 url followed by an access denied. Why?
It can take time for CloudFront distribution domain name to propagate through DNS- it can take 3 -4 hours for DNS to propagate fully.
We want to use an S3 bucket as an Origin for a CloudFront distribution, but we don’t want to allow public access to the content stored on that bucket. Is there a way to limit access to the bucket to CloudFront only?
Yes. An Origin Access Identity will limit access to the S3 bucket to CloudFront only and allow only s3:GetObject requests by that Identity.
Which of the Following can CloudFront base its Caching On (3)?:
Query String Host Name Session Cookie Source IP Request Header
Query String
Request Header
Session Cookie
We have a CloudFront distribution set up, but we want to limit access to it to only Premium users who have signed up to it. There are two ways of doing this - what are they
Either a signed CloudFront URL or a signed CloudFront Cookie will acheive this