Menu
Amazon CloudFront
API Reference (API Version 2016-09-29)

CreateDistributionWithTags

Create a new distribution with tags.

Request Syntax

POST /2016-09-29/distribution?WithTags HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<CreateDistributionWithTagsRequest>
   <DistributionConfigWithTags>
      <DistributionConfig>
         <Aliases>
            <Items>
               <CNAME>string</CNAME></Items>
            <Quantity>integer</Quantity>
         </Aliases>
         <CacheBehaviors>
            <Items>
               <CacheBehavior>
                  <AllowedMethods>
                     <CachedMethods>
                        <Items>
                           <Method>string</Method></Items>
                        <Quantity>integer</Quantity>
                     </CachedMethods>
                     <Items>
                        <Method>string</Method></Items>
                     <Quantity>integer</Quantity>
                  </AllowedMethods>
                  <Compress>boolean</Compress>
                  <DefaultTTL>long</DefaultTTL>
                  <ForwardedValues>
                     <Cookies>
                        <Forward>string</Forward>
                        <WhitelistedNames>
                           <Items>
                              <Name>string</Name></Items>
                           <Quantity>integer</Quantity>
                        </WhitelistedNames>
                     </Cookies>
                     <Headers>
                        <Items>
                           <Name>string</Name></Items>
                        <Quantity>integer</Quantity>
                     </Headers>
                     <QueryString>boolean</QueryString>
                     <QueryStringCacheKeys>
                        <Items>
                           <Name>string</Name></Items>
                        <Quantity>integer</Quantity>
                     </QueryStringCacheKeys>
                  </ForwardedValues>
                  <MaxTTL>long</MaxTTL>
                  <MinTTL>long</MinTTL>
                  <PathPattern>string</PathPattern>
                  <SmoothStreaming>boolean</SmoothStreaming>
                  <TargetOriginId>string</TargetOriginId>
                  <TrustedSigners>
                     <Enabled>boolean</Enabled>
                     <Items>
                        <AwsAccountNumber>string</AwsAccountNumber></Items>
                     <Quantity>integer</Quantity>
                  </TrustedSigners>
                  <ViewerProtocolPolicy>string</ViewerProtocolPolicy>
               </CacheBehavior></Items>
            <Quantity>integer</Quantity>
         </CacheBehaviors>
         <CallerReference>string</CallerReference>
         <Comment>string</Comment>
         <CustomErrorResponses>
            <Items>
               <CustomErrorResponse>
                  <ErrorCachingMinTTL>long</ErrorCachingMinTTL>
                  <ErrorCode>integer</ErrorCode>
                  <ResponseCode>string</ResponseCode>
                  <ResponsePagePath>string</ResponsePagePath>
               </CustomErrorResponse></Items>
            <Quantity>integer</Quantity>
         </CustomErrorResponses>
         <DefaultCacheBehavior>
            <AllowedMethods>
               <CachedMethods>
                  <Items>
                     <Method>string</Method></Items>
                  <Quantity>integer</Quantity>
               </CachedMethods>
               <Items>
                  <Method>string</Method></Items>
               <Quantity>integer</Quantity>
            </AllowedMethods>
            <Compress>boolean</Compress>
            <DefaultTTL>long</DefaultTTL>
            <ForwardedValues>
               <Cookies>
                  <Forward>string</Forward>
                  <WhitelistedNames>
                     <Items>
                        <Name>string</Name></Items>
                     <Quantity>integer</Quantity>
                  </WhitelistedNames>
               </Cookies>
               <Headers>
                  <Items>
                     <Name>string</Name></Items>
                  <Quantity>integer</Quantity>
               </Headers>
               <QueryString>boolean</QueryString>
               <QueryStringCacheKeys>
                  <Items>
                     <Name>string</Name></Items>
                  <Quantity>integer</Quantity>
               </QueryStringCacheKeys>
            </ForwardedValues>
            <MaxTTL>long</MaxTTL>
            <MinTTL>long</MinTTL>
            <SmoothStreaming>boolean</SmoothStreaming>
            <TargetOriginId>string</TargetOriginId>
            <TrustedSigners>
               <Enabled>boolean</Enabled>
               <Items>
                  <AwsAccountNumber>string</AwsAccountNumber></Items>
               <Quantity>integer</Quantity>
            </TrustedSigners>
            <ViewerProtocolPolicy>string</ViewerProtocolPolicy>
         </DefaultCacheBehavior>
         <DefaultRootObject>string</DefaultRootObject>
         <Enabled>boolean</Enabled>
         <HttpVersion>string</HttpVersion>
         <IsIPV6Enabled>boolean</IsIPV6Enabled>
         <Logging>
            <Bucket>string</Bucket>
            <Enabled>boolean</Enabled>
            <IncludeCookies>boolean</IncludeCookies>
            <Prefix>string</Prefix>
         </Logging>
         <Origins>
            <Items>
               <Origin>
                  <CustomHeaders>
                     <Items>
                        <OriginCustomHeader>
                           <HeaderName>string</HeaderName>
                           <HeaderValue>string</HeaderValue>
                        </OriginCustomHeader></Items>
                     <Quantity>integer</Quantity>
                  </CustomHeaders>
                  <CustomOriginConfig>
                     <HTTPPort>integer</HTTPPort>
                     <HTTPSPort>integer</HTTPSPort>
                     <OriginProtocolPolicy>string</OriginProtocolPolicy>
                     <OriginSslProtocols>
                        <Items>
                           <SslProtocol>string</SslProtocol></Items>
                        <Quantity>integer</Quantity>
                     </OriginSslProtocols>
                  </CustomOriginConfig>
                  <DomainName>string</DomainName>
                  <Id>string</Id>
                  <OriginPath>string</OriginPath>
                  <S3OriginConfig>
                     <OriginAccessIdentity>string</OriginAccessIdentity>
                  </S3OriginConfig>
               </Origin></Items>
            <Quantity>integer</Quantity>
         </Origins>
         <PriceClass>string</PriceClass>
         <Restrictions>
            <GeoRestriction>
               <Items>
                  <Location>string</Location></Items>
               <Quantity>integer</Quantity>
               <RestrictionType>string</RestrictionType>
            </GeoRestriction>
         </Restrictions>
         <ViewerCertificate>
            <ACMCertificateArn>string</ACMCertificateArn>
            <Certificate>string</Certificate>
            <CertificateSource>string</CertificateSource>
            <CloudFrontDefaultCertificate>boolean</CloudFrontDefaultCertificate>
            <IAMCertificateId>string</IAMCertificateId>
            <MinimumProtocolVersion>string</MinimumProtocolVersion>
            <SSLSupportMethod>string</SSLSupportMethod>
         </ViewerCertificate>
         <WebACLId>string</WebACLId>
      </DistributionConfig>
      <Tags>
         <Items>
            <Tag>
               <Key>string</Key>
               <Value>string</Value>
            </Tag></Items>
      </Tags>
   </DistributionConfigWithTags>
</CreateDistributionWithTagsRequest>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request requires the following data in XML format.

CreateDistributionWithTagsRequest

Root level tag for the CreateDistributionWithTagsRequest parameters.

Required: Yes

DistributionConfigWithTags

The distribution's configuration information.

Type: DistributionConfigWithTags object

Required: Yes

Response Syntax

HTTP/1.1 201
Location: Location
ETag: ETag
<?xml version="1.0" encoding="UTF-8"?>
<CreateDistributionWithTagsResult>
   <Distribution>
      <ActiveTrustedSigners>
         <Enabled>boolean</Enabled>
         <Items>
            <Signer>
               <AwsAccountNumber>string</AwsAccountNumber>
               <KeyPairIds>
                  <Items>
                     <KeyPairId>string</KeyPairId></Items>
                  <Quantity>integer</Quantity>
               </KeyPairIds>
            </Signer></Items>
         <Quantity>integer</Quantity>
      </ActiveTrustedSigners>
      <ARN>string</ARN>
      <DistributionConfig>
         <Aliases>
            <Items>
               <CNAME>string</CNAME></Items>
            <Quantity>integer</Quantity>
         </Aliases>
         <CacheBehaviors>
            <Items>
               <CacheBehavior>
                  <AllowedMethods>
                     <CachedMethods>
                        <Items>
                           <Method>string</Method></Items>
                        <Quantity>integer</Quantity>
                     </CachedMethods>
                     <Items>
                        <Method>string</Method></Items>
                     <Quantity>integer</Quantity>
                  </AllowedMethods>
                  <Compress>boolean</Compress>
                  <DefaultTTL>long</DefaultTTL>
                  <ForwardedValues>
                     <Cookies>
                        <Forward>string</Forward>
                        <WhitelistedNames>
                           <Items>
                              <Name>string</Name></Items>
                           <Quantity>integer</Quantity>
                        </WhitelistedNames>
                     </Cookies>
                     <Headers>
                        <Items>
                           <Name>string</Name></Items>
                        <Quantity>integer</Quantity>
                     </Headers>
                     <QueryString>boolean</QueryString>
                     <QueryStringCacheKeys>
                        <Items>
                           <Name>string</Name></Items>
                        <Quantity>integer</Quantity>
                     </QueryStringCacheKeys>
                  </ForwardedValues>
                  <MaxTTL>long</MaxTTL>
                  <MinTTL>long</MinTTL>
                  <PathPattern>string</PathPattern>
                  <SmoothStreaming>boolean</SmoothStreaming>
                  <TargetOriginId>string</TargetOriginId>
                  <TrustedSigners>
                     <Enabled>boolean</Enabled>
                     <Items>
                        <AwsAccountNumber>string</AwsAccountNumber></Items>
                     <Quantity>integer</Quantity>
                  </TrustedSigners>
                  <ViewerProtocolPolicy>string</ViewerProtocolPolicy>
               </CacheBehavior></Items>
            <Quantity>integer</Quantity>
         </CacheBehaviors>
         <CallerReference>string</CallerReference>
         <Comment>string</Comment>
         <CustomErrorResponses>
            <Items>
               <CustomErrorResponse>
                  <ErrorCachingMinTTL>long</ErrorCachingMinTTL>
                  <ErrorCode>integer</ErrorCode>
                  <ResponseCode>string</ResponseCode>
                  <ResponsePagePath>string</ResponsePagePath>
               </CustomErrorResponse></Items>
            <Quantity>integer</Quantity>
         </CustomErrorResponses>
         <DefaultCacheBehavior>
            <AllowedMethods>
               <CachedMethods>
                  <Items>
                     <Method>string</Method></Items>
                  <Quantity>integer</Quantity>
               </CachedMethods>
               <Items>
                  <Method>string</Method></Items>
               <Quantity>integer</Quantity>
            </AllowedMethods>
            <Compress>boolean</Compress>
            <DefaultTTL>long</DefaultTTL>
            <ForwardedValues>
               <Cookies>
                  <Forward>string</Forward>
                  <WhitelistedNames>
                     <Items>
                        <Name>string</Name></Items>
                     <Quantity>integer</Quantity>
                  </WhitelistedNames>
               </Cookies>
               <Headers>
                  <Items>
                     <Name>string</Name></Items>
                  <Quantity>integer</Quantity>
               </Headers>
               <QueryString>boolean</QueryString>
               <QueryStringCacheKeys>
                  <Items>
                     <Name>string</Name></Items>
                  <Quantity>integer</Quantity>
               </QueryStringCacheKeys>
            </ForwardedValues>
            <MaxTTL>long</MaxTTL>
            <MinTTL>long</MinTTL>
            <SmoothStreaming>boolean</SmoothStreaming>
            <TargetOriginId>string</TargetOriginId>
            <TrustedSigners>
               <Enabled>boolean</Enabled>
               <Items>
                  <AwsAccountNumber>string</AwsAccountNumber></Items>
               <Quantity>integer</Quantity>
            </TrustedSigners>
            <ViewerProtocolPolicy>string</ViewerProtocolPolicy>
         </DefaultCacheBehavior>
         <DefaultRootObject>string</DefaultRootObject>
         <Enabled>boolean</Enabled>
         <HttpVersion>string</HttpVersion>
         <IsIPV6Enabled>boolean</IsIPV6Enabled>
         <Logging>
            <Bucket>string</Bucket>
            <Enabled>boolean</Enabled>
            <IncludeCookies>boolean</IncludeCookies>
            <Prefix>string</Prefix>
         </Logging>
         <Origins>
            <Items>
               <Origin>
                  <CustomHeaders>
                     <Items>
                        <OriginCustomHeader>
                           <HeaderName>string</HeaderName>
                           <HeaderValue>string</HeaderValue>
                        </OriginCustomHeader></Items>
                     <Quantity>integer</Quantity>
                  </CustomHeaders>
                  <CustomOriginConfig>
                     <HTTPPort>integer</HTTPPort>
                     <HTTPSPort>integer</HTTPSPort>
                     <OriginProtocolPolicy>string</OriginProtocolPolicy>
                     <OriginSslProtocols>
                        <Items>
                           <SslProtocol>string</SslProtocol></Items>
                        <Quantity>integer</Quantity>
                     </OriginSslProtocols>
                  </CustomOriginConfig>
                  <DomainName>string</DomainName>
                  <Id>string</Id>
                  <OriginPath>string</OriginPath>
                  <S3OriginConfig>
                     <OriginAccessIdentity>string</OriginAccessIdentity>
                  </S3OriginConfig>
               </Origin></Items>
            <Quantity>integer</Quantity>
         </Origins>
         <PriceClass>string</PriceClass>
         <Restrictions>
            <GeoRestriction>
               <Items>
                  <Location>string</Location></Items>
               <Quantity>integer</Quantity>
               <RestrictionType>string</RestrictionType>
            </GeoRestriction>
         </Restrictions>
         <ViewerCertificate>
            <ACMCertificateArn>string</ACMCertificateArn>
            <Certificate>string</Certificate>
            <CertificateSource>string</CertificateSource>
            <CloudFrontDefaultCertificate>boolean</CloudFrontDefaultCertificate>
            <IAMCertificateId>string</IAMCertificateId>
            <MinimumProtocolVersion>string</MinimumProtocolVersion>
            <SSLSupportMethod>string</SSLSupportMethod>
         </ViewerCertificate>
         <WebACLId>string</WebACLId>
      </DistributionConfig>
      <DomainName>string</DomainName>
      <Id>string</Id>
      <InProgressInvalidationBatches>integer</InProgressInvalidationBatches>
      <LastModifiedTime>timestamp</LastModifiedTime>
      <Status>string</Status>
   </Distribution>
</CreateDistributionWithTagsResult>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The response returns the following HTTP headers.

ETag

The current version of the distribution created.

Location

The fully qualified URI of the new distribution resource just created. For example: https://cloudfront.amazonaws.com/2010-11-01/distribution/EDFDVBD632BHDS5.

The following data is returned in XML format by the service.

CreateDistributionWithTagsResult

Root level tag for the CreateDistributionWithTagsResult parameters.

Required: Yes

Distribution

The distribution's information.

Type: Distribution object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDenied

Access denied.

HTTP Status Code: 403

CNAMEAlreadyExists

HTTP Status Code: 409

DistributionAlreadyExists

The caller reference you attempted to create the distribution with is associated with another distribution.

HTTP Status Code: 409

InconsistentQuantities

The value of Quantity and the size of Items do not match.

HTTP Status Code: 400

InvalidArgument

The argument is invalid.

HTTP Status Code: 400

InvalidDefaultRootObject

The default root object file name is too big or contains an invalid character.

HTTP Status Code: 400

InvalidErrorCode

HTTP Status Code: 400

InvalidForwardCookies

Your request contains forward cookies option which doesn't match with the expectation for the whitelisted list of cookie names. Either list of cookie names has been specified when not allowed or list of cookie names is missing when expected.

HTTP Status Code: 400

InvalidGeoRestrictionParameter

HTTP Status Code: 400

InvalidHeadersForS3Origin

HTTP Status Code: 400

InvalidLocationCode

HTTP Status Code: 400

InvalidMinimumProtocolVersion

HTTP Status Code: 400

InvalidOrigin

The Amazon S3 origin server specified does not refer to a valid Amazon S3 bucket.

HTTP Status Code: 400

InvalidOriginAccessIdentity

The origin access identity is not valid or doesn't exist.

HTTP Status Code: 400

InvalidProtocolSettings

You cannot specify SSLv3 as the minimum protocol version if you only want to support only clients that support Server Name Indication (SNI).

HTTP Status Code: 400

InvalidQueryStringParameters

HTTP Status Code: 400

InvalidRelativePath

The relative path is too big, is not URL-encoded, or does not begin with a slash (/).

HTTP Status Code: 400

InvalidRequiredProtocol

This operation requires the HTTPS protocol. Ensure that you specify the HTTPS protocol in your request, or omit the RequiredProtocols element from your distribution configuration.

HTTP Status Code: 400

InvalidResponseCode

HTTP Status Code: 400

InvalidTagging

HTTP Status Code: 400

InvalidTTLOrder

HTTP Status Code: 400

InvalidViewerCertificate

HTTP Status Code: 400

InvalidWebACLId

HTTP Status Code: 400

MissingBody

This operation requires a body. Ensure that the body is present and the Content-Type header is set.

HTTP Status Code: 400

NoSuchOrigin

No origin exists with the specified Origin Id.

HTTP Status Code: 404

TooManyCacheBehaviors

You cannot create more cache behaviors for the distribution.

HTTP Status Code: 400

TooManyCertificates

You cannot create anymore custom SSL/TLS certificates.

HTTP Status Code: 400

TooManyCookieNamesInWhiteList

Your request contains more cookie names in the whitelist than are allowed per cache behavior.

HTTP Status Code: 400

TooManyDistributionCNAMEs

Your request contains more CNAMEs than are allowed per distribution.

HTTP Status Code: 400

TooManyDistributions

Processing your request would cause you to exceed the maximum number of distributions allowed.

HTTP Status Code: 400

TooManyHeadersInForwardedValues

HTTP Status Code: 400

TooManyOriginCustomHeaders

HTTP Status Code: 400

TooManyOrigins

You cannot create more origins for the distribution.

HTTP Status Code: 400

TooManyQueryStringParameters

HTTP Status Code: 400

TooManyTrustedSigners

Your request contains more trusted signers than are allowed per distribution.

HTTP Status Code: 400

TrustedSignerDoesNotExist

One or more of your trusted signers do not exist.

HTTP Status Code: 400