Amazon CloudFront – Domains, DNS, and Content Delivery – SOA-C02 Study Guide

Amazon CloudFront

This section covers the following objective of Domain 5 (Networking and Content Delivery) from the official AWS Certified SysOps Administrator – Associate (SOA-C02) exam guide:

5.2 Configure domains, DNS services, and content delivery

CramSaver

If you can correctly answer these questions before going through this section, save time by skimming the Exam Alerts in this section and then completing the Cram Quiz at the end of the section.

1. How is traffic directed to the CloudFront Edge locations?

2. What are some options to remove outdated data from the CloudFront cache more quickly?

Answers

1. Answer: A Route 53 DNS record is used to redirect website traffic to a CloudFront distribution.

2. Answer: You can create an invalidation to remove objects from the cache. You can also create a new version of an object with a new name and update your website to reflect the new object.

Introduction to CloudFront

CloudFront is a content delivery network service that speeds up delivery of your static and dynamic web content. CloudFront spans a worldwide network of edge locations that are used to cache content. Route 53 is used to direct user requests to the CloudFront edge location that provides the lowest latency. If possible, the content is delivered to the user directly from the edge location. If a cache miss occurs, the content is delivered from the origin (an S3 bucket, EC2 instance, or a web server in an on-premises datacenter.)

Creating a CloudFront Distribution

CloudFront always begins with an origin. In this case, assume the origin is content in an S3 bucket. You can create a CloudFront distribution with the S3 bucket set as the origin. In Figure 12.12, the Origin Domain Name is configured to point to an S3 bucket. The Origin Path has not been configured but would allow you to specify a directory within the bucket. You can also set Restrict Bucket Access to an Origin Access Identity. That topic is covered in the next section.

FIGURE 12.12 Creating a CloudFront distribution

Time-to-Live (TTL)

Data that is stored in the CloudFront Edge locations is considered current for a specific amount of time, as defined by the TTL. If data changes in the origin (for example, a video file is replaced in an S3 bucket), those changes are not visible to the end user until the TTL expires, and the cached version of the object is replaced. If you need to remove a file from CloudFront edge caches before it expires, you can perform an invalidation. You could also create a new version of an object, with a new name, and repoint the links on your website to that new version. But the easiest method of expiring the contents of the cache is with the TTL. In Figure 12.13, you can see the TTL configuration for a CloudFront distribution.

FIGURE 12.13 CloudFront TTL

Price Classes

The default price class for CloudFront includes all edge locations, which provides the best possible performance worldwide, but also is the most expensive option. Depending on the geographic location of your end users, you might be able to save money without a negative impact by choosing a different price class. In Figure 12.14, you can see the different price class options for a CloudFront distribution.

FIGURE 12.14 Price class