DistributionConfig Complex Type

Description

The DistributionConfig complex type describes a distribution's configuration information. For more information about distributions, go to Working with Distributions in the Amazon CloudFront Developer Guide.

This complex type is used as a request element in POST Distribution and PUT Distribution Config.

It is used as a response element in GET Distribution and GET Distribution Config.

Syntax

<DistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2009-12-01/">
   <Origin/>
   <CallerReference/>
   <CNAME/>
   <Comment/>
   <Enabled/>
   <Logging>
      <Bucket/>
      <Prefix/>
   </Logging>
   <OriginAccessIdentity/>
   <TrustedSigners>
      <Self/>
      <AwsAccountNumber/>
   </TrustedSigners>
</DistributionConfig>

Elements

The following table describes the child elements in the DistributionConfig datatype. They're presented in the order they appear in the configuration, and not in alphabetical order.

NameDescriptionRequired

Origin

The Amazon S3 bucket to associate with the distribution. For example: mybucket.s3.amazonaws.com.

Type: String

Constraints: Maximum 128 characters

Default: None

Yes

CallerReference

A unique number that ensures the request can't be replayed.

If the CallerReference is new (no matter the content of the DistributionConfig object), a new distribution is created.

If the CallerReference is a value you already sent in a previous request to create a distribution, and the content of the DistributionConfig is identical to the original request (ignoring white space), the response includes the same information returned to the original request.

If the CallerReference is a value you already sent in a previous request to create a distribution but the content of the DistributionConfig is different from the original request, CloudFront returns a DistributionAlreadyExists error.

Type: String

Constraints: Allowable characters are any Unicode code points that are legal in an XML 1.0 document. The UTF-8 encoding of the value must be less than 128 bytes.

Default: None

Yes

CNAME

A CNAME alias you want to associate with this distribution. You can have up to 10 CNAME aliases per distribution. For more information, go to Using CNAMEs in the Amazon CloudFront Developer Guide.

Only include a CNAME element if you have a CNAME to associate with the distribution. Don't include an empty CNAME element in the DistributionConfig object. If you do, CloudFront returns a MalformedXML error.

Type: String

Valid Value: The CNAME alias

Default: None

No

Comment

Any comments you want to include about the distribution.

Type: String

Constraints: Maximum 128 characters

Default: None

No

Enabled

Whether the distribution is enabled to accept end user requests for content.

Type: Boolean

Valid Values: false | true

Default: None

Yes

Logging

A complex type that controls whether access logs are written for the distribution. If you want to turn on access logs, include this element; if you want to turn off access logs, remove this element. For more information, go to Access Logs in the Amazon CloudFront Developer Guide.

Type: Complex type

Children: Bucket, Prefix (for descriptions, see Logging Child Elements)

Default: None

No

OriginAccessIdentity

The CloudFront origin access identity to associate with the distribution. If you want the distribution to serve private content, include this element; if you want the distribution to serve public content, remove this element. For more information, go to Serving Private Content in the Amazon CloudFront Developer Guide.

Type: String

Constraints: Must be in format origin-access-identity/cloudfront/ID

Default: None

No

TrustedSigners

A complex type that specifies any AWS accounts you want to permit to create signed URLs for private content. If you want the distribution to use signed URLs, include this element; if you want the distribution to use basic URLs, remove this element. For more information, go to Serving Private Content in the Amazon CloudFront Developer Guide.

Type: Complex type

Children: Self, AwsAccountNumber (for descriptions, see TrustedSigners Child Elements)

Default: None

No

Logging Child Elements

The following table describes the child elements of the Logging element.

NameDescriptionRequired

Bucket

The Amazon S3 bucket to store the access logs in. For example: mylogs.s3.amazonaws.com.

Type: String

Constraints: Maximum 128 characters

Default: None

Yes

Prefix

An optional string of your choice to prefix to the access log filenames for this distribution. For example: myprefix/.

If you decide not to use a prefix, you must still include the empty Prefix element in the Logging element.

Type: String

Constraints: Maximum 256 characters; the string must not start with a slash ( / ).

Default: None

No

TrustedSigners Child Elements

The following table describes the child elements of the TrustedSigners element.

NameDescriptionRequired

Self

Include this empty element if you want to give your own AWS account permission to create signed URLs.

Type: String

Default: None

No

AwsAccountNumber

Specifies an AWS account that can create signed URLs. Remove the dashes. You can specify up to five accounts, each with its own AwsAccountNumber element.

Type: String

Default: None

No

Examples

The following example configuration is for a public content distribution with no CNAME aliases, and logging turned off.

<DistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2009-12-01/">
   <Origin>mybucket.s3.amazonaws.com</Origin>
   <CallerReference>20091130090000</CallerReference>
   <Comment>My comments</Comment>
   <Enabled>true</Enabled>
</DistributionConfig>

The following example configuration is for a distribution that serves private content with signed URLs and with two CNAME aliases. The presence of the Logging element means that logging is turned on for this distribution.

<DistributionConfig xmlns="http://cloudfront.amazonaws.com/doc/2009-12-01/">
   <Origin>mybucket.s3.amazonaws.com</Origin>
   <CallerReference>20091130090000</CallerReference>
   <CNAME>beagles.com</CNAME>
   <CNAME>beagles.dogs.com</CNAME>
   <Comment>My comments</Comment>
   <Enabled>true</Enabled>
   <Logging>
      <Bucket>mylogs.s3.amazonaws.com</Bucket>
      <Prefix/>
   </Logging>
   <OriginAccessIdentity>origin-access-identity/cloudfront/E74FTE3AJFJ256A</OriginAccessIdentity>
   <TrustedSigners>
      <Self/>
      <AwsAccountNumber>123456789012</AwsAccountNumber>
      <AwsAccountNumber>987654321111</AwsAccountNumber>
   </TrustedSigners>
</DistributionConfig>