Skip to content

CloudFront  >  Operations  >  copy_distribution

copy_distribution

Operation

copy_distribution async

copy_distribution(input: CopyDistributionInput, plugins: list[Plugin] | None = None) -> CopyDistributionOutput

Creates a staging distribution using the configuration of the provided primary distribution. A staging distribution is a copy of an existing distribution (called the primary distribution) that you can use in a continuous deployment workflow.

After you create a staging distribution, you can use UpdateDistribution to modify the staging distribution's configuration. Then you can use CreateContinuousDeploymentPolicy to incrementally move traffic to the staging distribution.

This API operation requires the following IAM permissions:

Parameters:

Name Type Description Default
input CopyDistributionInput

An instance of CopyDistributionInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CopyDistributionOutput

An instance of CopyDistributionOutput.

Input

CopyDistributionInput dataclass

Bases: _SerdeShape

Dataclass for CopyDistributionInput structure.

Attributes

caller_reference class-attribute instance-attribute
caller_reference: str | None = ...

A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.

enabled class-attribute instance-attribute
enabled: bool | None = ...

A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to True, the staging distribution is enabled. When you set this value to False, the staging distribution is disabled.

If you omit this field, the default value is True.

if_match class-attribute instance-attribute
if_match: str | None = ...

The version identifier of the primary distribution whose configuration you are copying. This is the ETag value returned in the response to GetDistribution and GetDistributionConfig.

primary_distribution_id class-attribute instance-attribute
primary_distribution_id: str | None = ...

The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use ListDistributions.

staging class-attribute instance-attribute
staging: bool | None = ...

The type of distribution that your primary distribution will be copied to. The only valid value is True, indicating that you are copying to a staging distribution.

Output

CopyDistributionOutput dataclass

Bases: _SerdeShape

Dataclass for CopyDistributionOutput structure.

Attributes

distribution class-attribute instance-attribute
distribution: Distribution | None = ...

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

e_tag class-attribute instance-attribute
e_tag: str | None = ...

The version identifier for the current version of the staging distribution.

location class-attribute instance-attribute
location: str | None = ...

The URL of the staging distribution.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.