CreateContinuousDeploymentPolicy - Amazon CloudFront

CreateContinuousDeploymentPolicy

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="http://cloudfront.amazonaws.com/doc/2020-05-31/"> <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.

ContinuousDeploymentPolicyConfig

Root level tag for the ContinuousDeploymentPolicyConfig parameters.

Required: Yes

Enabled

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

StagingDistributionDnsNames

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

Type: StagingDistributionDnsNames object

Required: Yes

TrafficConfig

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.

ContinuousDeploymentPolicy

Root level tag for the ContinuousDeploymentPolicy parameters.

Required: Yes

ContinuousDeploymentPolicyConfig

Contains the configuration for a continuous deployment policy.

Type: ContinuousDeploymentPolicyConfig object

Id

The identifier of the continuous deployment policy.

Type: String

LastModifiedTime

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

Type: Timestamp

Errors

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

AccessDenied

Access denied.

HTTP Status Code: 403

ContinuousDeploymentPolicyAlreadyExists

A continuous deployment policy with this configuration already exists.

HTTP Status Code: 409

InconsistentQuantities

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

HTTP Status Code: 400

InvalidArgument

An argument is invalid.

HTTP Status Code: 400

StagingDistributionInUse

A continuous deployment policy for this staging distribution already exists.

HTTP Status Code: 409

TooManyContinuousDeploymentPolicies

You have reached the maximum number of continuous deployment policies for this AWS account.

HTTP Status Code: 400

See Also

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