| Did this page help you? Yes No Tell us about it... |
This section describes the parts of a distribution.
To have CloudFront recognize your objects, you create a distribution by using the CloudFront control API (for more information about creating a download distribution, go to POST Distribution in the Amazon CloudFront API Reference).
When you create any type of distribution, you must specify three things:
The origin server
Caller reference
Whether the distribution should be enabled or disabled upon creation
You can optionally provide these other components:
One or more CNAME aliases for the distribution's domain name
Comments about the distribution
Whether access logs are written for the distribution (download distributions only)
A CloudFront origin access identity to use with the distribution (required for CloudFront to fetch private objects from an Amazon S3 bucket)
Any trusted signers (required to create a signed URL, which controls whether the end user has access to the cached object)
When you create the distribution with the CloudFront control API, you provide
an XML document that contains this information (for download distributions, it's in an
element called DistributionConfig; for streaming distributions, it's
StreamingDistributionConfig). For more information about download
distributions, go to DistributionConfig Complex Type in the
Amazon CloudFront API Reference. For more information about streaming
distributions, go to Streaming
DistributionConfig Complex Type in the
Amazon CloudFront API Reference.
When you create the distribution, you specify the origin server either as an Amazon S3 bucket, or as a custom origin.
When you use Amazon S3 as your origin, you place any objects you want delivered through CloudFront in an Amazon S3 bucket. How you get your objects into Amazon S3 doesn't matter (you might use the Amazon S3 API or another tool). You can create a hierarchy in your bucket to store the objects, just like you would with any other Amazon S3 bucket. You incur regular Amazon S3 charges for storing the objects in the bucket (for more information about the charges to use CloudFront, see Paying for CloudFront).
![]() | Note |
|---|---|
Using an existing Amazon S3 bucket as your CloudFront origin server doesn't change that bucket in any way; you can still use it as you normally would to store and access Amazon S3 objects (at the normal Amazon S3 prices). |
You specify the Amazon S3 bucket's name using this format: <bucket name>.s3.amazonaws.com. Do not use the Amazon S3 path style for specifying the bucket, which is s3.amazonaws.com/<bucket name>. If the bucket has a CNAME alias, you must specify the bucket name and not the CNAME alias.
For more information about creating a distribution with an Amazon S3 origin, see Start Using CloudFront with Amazon S3 in the Amazon CloudFront Getting Started Guide.
![]() | Important |
|---|---|
In the early days of Amazon S3, you could create DNS-incompatible bucket names. For your bucket to work with CloudFront, it must conform to DNS requirements. For more information, go to Bucket Restrictions and Limitations in the Amazon Simple Storage Service Developer Guide. |
A custom origin is any origin server that isn't hosted on Amazon S3. A custom origin might be located on a set of servers you manage privately, or it could be an Amazon EC2 instance.
When you use a custom origin, you specify the origin server as a DNS name, along with the port and protocol policy for the origin. To learn how to create a distribution with a custom origin, see Creating a Distribution with a Custom Origin.
You can use most CloudFront features with a custom origin, but there are a few exceptions. Currently, the following features are not available with custom origins:
Streaming distributions—Not supported.
Private content—Although you can use a signed URL to distribute content from a custom origin, for CloudFront to access the custom origin, the origin must remain publicly accessible.
For information about requirements and recommendations when using custom origins, see Requirements and Recommendations for Using Amazon EC2 and Other Custom Origins.
You typically create one distribution per origin server, although you could
create multiple distributions per origin server. For example, if you had two distributions
for one origin server, you could reference a single object
using either distribution. In this case, if you had an image file called
image.jpg in your origin server, CloudFront would
work with each distribution as though it referenced an individual image.jpg object: one
image.jpg accessible through one distribution, and
another image.jpg accessible through the other
distribution.
![]() | Note |
|---|---|
After you create a distribution, you can't change its origin server. If you need to change the origin server for a distribution, you must create a new distribution that uses the new origin server and update either your links or your DNS records to use the new distribution's domain name. You can then delete the original distribution (for more information, see Deleting a Distribution). |
The caller reference is a unique value that you provide and CloudFront uses to prevent replays of your request. You must provide a new caller reference value and other new information in the request for CloudFront to create a new distribution. You could use a time stamp for the caller reference (for example: 20091130090000).
If you pass the same caller reference value and the rest of the request is the same, CloudFront doesn't create a new distribution. Instead, it returns information about the distribution you previously created with that caller reference.
If you pass the same caller reference value, but vary other information in the
request, CloudFront returns a DistributionAlreadyExists error
(for more information about errors, see Error Responses).
After you create a distribution, you can't change its caller reference.
When you create a distribution, you must tell CloudFront if you want the distribution to be enabled or disabled once it's created. Enabled means that as soon as the distribution is fully deployed you can deploy links that use the distribution's domain name and end users can retrieve content. In other words, whenever a distribution is enabled, CloudFront accepts and handles any end-user requests for content that use the domain name associated with that distribution. For more information about full deployment, see Eventual Consistency.
Disabled means that even though the distribution might be deployed and ready to use, end users can't use it. In other words, whenever a distribution is disabled, CloudFront doesn't accept any end-user requests that use the domain name associated with that distribution. Until you switch the distribution from disabled to enabled (by updating the distribution's configuration), no one can use it.
You can toggle a distribution between disabled and enabled as often as you like. Make sure to follow the process for updating a distribution's configuration (for more information, see Updating a Distribution's Configuration).
You can optionally associate one or more CNAME aliases with a distribution so that you can use a domain name of your choice in links to your objects instead of the domain name CloudFront assigns. For more information, see Using CNAMEs.
When you create a distribution, you can provide optional comments about the distribution. You can update those comments at any time. The maximum allowed length is 128 characters.
This component applies only to download distributions.
When you create a download distribution, you can enable logging for the distribution. This means that CloudFront records information about each end user request for an object and stores the files in an Amazon S3 bucket of your choice. You can turn logging on or off for the download and streaming distributions at any time. For more information, see Access Logs.
When you create a distribution, you can:
Use the origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront
Use trusted signers to configure the distribution so that you control end-user access to cached objects (through the use of a signed URL)
For more information about origin access identity and trusted signers, see Using a Signed URL to Serve Private Content.
When you create a new distribution, CloudFront returns the following information:
The distribution's ID (e.g., EDFDVBD632BHDS5)
The distribution's domain name (e.g.,
d604721fxaaqy9.cloudfront.net)
The distribution's current status
When the distribution was last modified
A list of the active trusted signers for the distribution
The distribution's ID won't necessarily match the domain
name. You can refer to the distribution by its ID (e.g.,
EDFDVBD632BHDS5). Whenever you perform an action on the
distribution, you provide its fully qualified ID. For example,
https://cloudfront.amazonaws.com/2010-11-01/distribution/EDFDVBD632BHDS5. For streaming distributions, the fully qualified ID
looks like: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8.
You use the distribution's domain name in the links to your objects, unless
you're using CNAME records (for more information, see Using CNAMEs). If your distribution's domain name is
d604721fxaaqy9.cloudfront.net, the link to the example images/image.jpg file would be
http://d604721fxaaqy9.cloudfront.net/images/image.jpg.
The possible status values for a distribution are listed in the following table.
| Value | Description |
|---|---|
|
|
The distribution is still being created or updated. |
|
|
The distribution has been created or updated and the changes have been fully propagated through the CloudFront system. |
![]() | Note |
|---|---|
Even if the distribution's status is |
The last modification time stamp uses the ISO 8601 format (e.g., 2009-11-19T19:37:58Z). For more information, go to http://www.w3.org/TR/NOTE-datetime.
CloudFront includes a list of the active trusted signers for the distribution. This information is included as part of the distribution only if you've set up the distribution to serve private content with a signed URL (for more information, see Using a Signed URL to Serve Private Content). Active trusted signers are trusted signers who have at least one active key pair that CloudFront is aware of. Only active trusted signers can create working signed URLs.