CreateContinuousDeploymentPolicy - Amazon CloudFront
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Creates a continuous deployment policy that distributes traffic for a custom domain name to two different CloudFront distributions.

To use a continuous deployment policy, first use CopyDistribution to create a staging distribution, then use UpdateDistribution to modify the staging distribution's configuration.

After you create and update a staging distribution, you can use a continuous deployment policy to incrementally move traffic to the staging distribution. This workflow enables you to test changes to a distribution's configuration before moving all of your domain's production traffic to the new configuration.

Request Syntax

POST /2020-05-31/continuous-deployment-policy HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <ContinuousDeploymentPolicyConfig xmlns=""> <Enabled>boolean</Enabled> <StagingDistributionDnsNames> <Items> <DnsName>string</DnsName> </Items> <Quantity>integer</Quantity> </StagingDistributionDnsNames> <TrafficConfig> <SingleHeaderConfig> <Header>string</Header> <Value>string</Value> </SingleHeaderConfig> <SingleWeightConfig> <SessionStickinessConfig> <IdleTTL>integer</IdleTTL> <MaximumTTL>integer</MaximumTTL> </SessionStickinessConfig> <Weight>float</Weight> </SingleWeightConfig> <Type>string</Type> </TrafficConfig> </ContinuousDeploymentPolicyConfig>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.


Root level tag for the ContinuousDeploymentPolicyConfig parameters.

Required: Yes


A Boolean that indicates whether this continuous deployment policy is enabled (in effect). When this value is true, this policy is enabled and in effect. When this value is false, this policy is not enabled and has no effect.

Type: Boolean

Required: Yes


The CloudFront domain name of the staging distribution. For example:

Type: StagingDistributionDnsNames object

Required: Yes


Contains the parameters for routing production traffic from your primary to staging distributions.

Type: TrafficConfig object

Required: No

Response Syntax

HTTP/1.1 201 <?xml version="1.0" encoding="UTF-8"?> <ContinuousDeploymentPolicy> <ContinuousDeploymentPolicyConfig> <Enabled>boolean</Enabled> <StagingDistributionDnsNames> <Items> <DnsName>string</DnsName> </Items> <Quantity>integer</Quantity> </StagingDistributionDnsNames> <TrafficConfig> <SingleHeaderConfig> <Header>string</Header> <Value>string</Value> </SingleHeaderConfig> <SingleWeightConfig> <SessionStickinessConfig> <IdleTTL>integer</IdleTTL> <MaximumTTL>integer</MaximumTTL> </SessionStickinessConfig> <Weight>float</Weight> </SingleWeightConfig> <Type>string</Type> </TrafficConfig> </ContinuousDeploymentPolicyConfig> <Id>string</Id> <LastModifiedTime>timestamp</LastModifiedTime> </ContinuousDeploymentPolicy>

Response Elements

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

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


Root level tag for the ContinuousDeploymentPolicy parameters.

Required: Yes


Contains the configuration for a continuous deployment policy.

Type: ContinuousDeploymentPolicyConfig object


The identifier of the continuous deployment policy.

Type: String


The date and time the continuous deployment policy was last modified.

Type: Timestamp


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


Access denied.

HTTP Status Code: 403


A continuous deployment policy with this configuration already exists.

HTTP Status Code: 409


The value of Quantity and the size of Items don't match.

HTTP Status Code: 400


An argument is invalid.

HTTP Status Code: 400


A continuous deployment policy for this staging distribution already exists.

HTTP Status Code: 409


You have reached the maximum number of continuous deployment policies for this Amazon Web Services account.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: