Amazon CloudFront is a content delivery service that works in conjunction with other Amazon Web Services (AWS) to provide developers with a simple way to distribute content to end users.
While Amazon Web Services (AWS) has established itself as a top contender in the cloud computing market, it’s not without its challenges and misconceptions. Get expert insight into the most common and pressing questions regarding AWS management, monitoring, costs, benefits, limitations and more.
This service is useful for companies with a need for higher response times and large file content that want to distribute these files to a sizeable number of users. Once content is put in an origin server, like an Amazon Simple Storage Service bucket or an Elastic Compute Cloud instance, it’s pushed out to multiple CloudFront servers as content is requested.
CloudFront has features similar to dynamic site acceleration, a method used to improve online content delivery, but it can’t change the structure of content, like shrinking files or converting images into sprites. CloudFront accelerates the delivery of dynamic content by moving it closer to the user to minimize internet hops involved in retrieving that content.
Amazon CloudFront is beneficial for someone developing a website that distributes a lot of content that needs to scale-up. It can help reduce the costs and improve the performance of a website by providing high data transfer speeds, low latency and pay as you go pricing.
Pre-Step:
- Create a storage bucket in AWS S3
Heads to CloudFront
Head over to AWS CloudFront and click the shiny blue Create Distribution button. This is where the magic happens. You’ll be prompted with two options to create a Web or RTMP distribution. Click Web.
The main setting you want to pay attention to here is the Origin Domain Name. Remember that S3 bucket Endpoint you took note of? We need to use that here instead of selecting the bucket from CloudFront’s autocomplete dropdown. You normally see the dropdown when you click inside the Origin Domain Name field.
If you’d like to use a custom domain that you have set up in Route53, you can specify it in the Alternate Domain Names field under Distribution Settings. Once complete, specify the Default Root Object to match your bucket’s Index Document and you’re all set!
The rest of your CloudFront settings are totally up to you in terms of your requirements. There are lots of different configuration options to choose from.
You can now click Create Distribution and watch your deployment happen.
Back in the list of your CloudFront Distributions, you’ll notice your newly created distribution is In Progress. This usually takes a few moments. But once it’s finished, you can copy the uniquely created Domain Name (eg: sjdcnsadncsdcfd.cloudfrent.net) and use this in Route53.
Route to Route53
Over in Route53 under your hosted zone for rentmatics.com, you want to create a record. Click the Create Record Set button and you’ll see options appear on the right.
For your record set you can leave the name field blank if you want to use the root level of your domain. In our case it’s rentmatics.com. Select the yes radio button for Alias and in the target field you want to paste your uniquely generated CloudFront domain we copied earlier. Before you click Create you need to make sure your distribution has a status of deployed.
For more redirection rule configuration samples, feel free to check out AWS’s documentation.
Be sure to stay tuned for more AWS tips and tutorials.