Amazon CloudFront
Developer Guide (API Version 2010-11-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

Migrating from Amazon S3 to CloudFront

If you currently distribute content from your Amazon S3 bucket using a CNAME, you can migrate to CloudFront with no disruption. This section describes the process.

Process for migrating from Amazon S3 to CloudFront

Process for Migrating from Amazon S3 to CloudFront

1

Create a CloudFront distribution. You can use one of the various GUI-based CloudFront tools available, or use the CloudFront control API directly. For information about the tools, go to the Amazon CloudFront Developer Tools.

When you create the distribution, provide the name of your Amazon S3 bucket as the origin server (in the format <bucket name>.s3.amazonaws.com).

Also provide the CNAME you've been using with the bucket.

For more information, see Parts of a Distribution and go to POST Distribution in the Amazon CloudFront API Reference.

2

Confirm your distribution is fully deployed (i.e., that its status is Deployed).

GUI-based tools for CloudFront typically display the distribution's status.

For more information about getting a distribution's status with the CloudFront control API, go to GET Distribution in the Amazon CloudFront API Reference.

3

Create test links to publicly readable objects in your Amazon S3 bucket, and test the links.

Make sure to use the distribution's DNS name in the links. For example, http://e604721fxaaqy9.cloudfront.net/images/image.jpg.

For more information about the link format, see Format of Links to Objects.

4

Update your existing DNS record to point to the distribution's domain name instead of the Amazon S3 bucket.

The exact procedure for configuring DNS depends on your DNS server or DNS provider and is beyond the scope of this document.


After you update the DNS record, the DNS system propagates your CNAME change throughout the DNS caches (a process that can take up to 72 hours, but usually happens faster). During this time, some requests for your content will resolve to the Amazon S3 bucket, and others to CloudFront.

To confirm that the switch from Amazon S3 to CloudFront has happened, you can use a DNS tool like dig to confirm that the CNAME points to the CloudFront distribution domain name, and not your Amazon S3 bucket (for information about dig, go to http://www.kloth.net/services/dig.php). You can also monitor the number of requests that are served from Amazon S3 versus CloudFront. The number of Amazon S3 requests should decrease, whereas it should increase for CloudFront. You can see the request numbers by viewing your AWS account activity or the AWS usage reports for Amazon S3 and CloudFront (for more information, see General Usage Data).

Related Topics