copy_distribution
async
¶
copy_distribution(
primary_distribution_id: string,
caller_reference: string,
*,
config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
staging: Optional[boolean] = None,
if_match: Optional[string] = None,
enabled: Optional[boolean] = None,
) -> CopyDistributionResult
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:
-
primary_distribution_id(string) –The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use
ListDistributions. -
staging(Optional[boolean], default: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. -
if_match(Optional[string], default:None) –The version identifier of the primary distribution whose configuration you are copying. This is the
ETagvalue returned in the response toGetDistributionandGetDistributionConfig. -
caller_reference(string) –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(Optional[boolean], default: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 toFalse, the staging distribution is disabled.If you omit this field, the default value is
True.
Raises:
-
AccessDenied–Access denied.
-
CNAMEAlreadyExists–The CNAME specified is already defined for CloudFront.
-
DistributionAlreadyExists–The caller reference you attempted to create the distribution with is associated with another distribution.
-
IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior–The specified configuration for field-level encryption can't be associated with the specified cache behavior.
-
InconsistentQuantities–The value of
Quantityand the size ofItemsdon't match. -
InvalidArgument–An argument is invalid.
-
InvalidDefaultRootObject–The default root object file name is too big or contains an invalid character.
-
InvalidErrorCode–An invalid error code was specified.
-
InvalidForwardCookies–Your request contains forward cookies option which doesn't match with the expectation for the
whitelistedlist of cookie names. Either list of cookie names has been specified when not allowed or list of cookie names is missing when expected. -
InvalidFunctionAssociation–A CloudFront function association is invalid.
-
InvalidGeoRestrictionParameter–The specified geo restriction parameter is not valid.
-
InvalidHeadersForS3Origin–The headers specified are not valid for an Amazon S3 origin.
-
InvalidIfMatchVersion–The
If-Matchversion is missing or not valid. -
InvalidLambdaFunctionAssociation–The specified Lambda@Edge function association is invalid.
-
InvalidLocationCode–The location code specified is not valid.
-
InvalidMinimumProtocolVersion–The minimum protocol version specified is not valid.
-
InvalidOrigin–The Amazon S3 origin server specified does not refer to a valid Amazon S3 bucket.
-
InvalidOriginAccessControl–The origin access control is not valid.
-
InvalidOriginAccessIdentity–The origin access identity is not valid or doesn't exist.
-
InvalidOriginKeepaliveTimeout–The keep alive timeout specified for the origin is not valid.
-
InvalidOriginReadTimeout–The read timeout specified for the origin is not valid.
-
InvalidProtocolSettings–You cannot specify SSLv3 as the minimum protocol version if you only want to support only clients that support Server Name Indication (SNI).
-
InvalidQueryStringParameters–The query string parameters specified are not valid.
-
InvalidRelativePath–The relative path is too big, is not URL-encoded, or does not begin with a slash (/).
-
InvalidRequiredProtocol–This operation requires the HTTPS protocol. Ensure that you specify the HTTPS protocol in your request, or omit the
RequiredProtocolselement from your distribution configuration. -
InvalidResponseCode–A response code is not valid.
-
InvalidTTLOrder–The TTL order specified is not valid.
-
InvalidViewerCertificate–A viewer certificate specified is not valid.
-
InvalidWebACLId–A web ACL ID specified is not valid. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example
arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. To specify a web ACL created using WAF Classic, use the ACL ID, for example473e64fd-f30b-4765-81a0-62ad96dd167a. -
MissingBody–This operation requires a body. Ensure that the body is present and the
Content-Typeheader is set. -
NoSuchCachePolicy–The cache policy does not exist.
-
NoSuchDistribution–The specified distribution does not exist.
-
NoSuchFieldLevelEncryptionConfig–The specified configuration for field-level encryption doesn't exist.
-
NoSuchOrigin–No origin exists with the specified
Origin Id. -
NoSuchOriginRequestPolicy–The origin request policy does not exist.
-
NoSuchRealtimeLogConfig–The real-time log configuration does not exist.
-
NoSuchResponseHeadersPolicy–The response headers policy does not exist.
-
PreconditionFailed–The precondition in one or more of the request fields evaluated to
false. -
RealtimeLogConfigOwnerMismatch–The specified real-time log configuration belongs to a different Amazon Web Services account.
-
TooManyCacheBehaviors–You cannot create more cache behaviors for the distribution.
-
TooManyCertificates–You cannot create anymore custom SSL/TLS certificates.
-
TooManyCookieNamesInWhiteList–Your request contains more cookie names in the whitelist than are allowed per cache behavior.
-
TooManyDistributionCNAMEs–Your request contains more CNAMEs than are allowed per distribution.
-
TooManyDistributions–Processing your request would cause you to exceed the maximum number of distributions allowed.
-
TooManyDistributionsAssociatedToCachePolicy–The maximum number of distributions have been associated with the specified cache policy. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsAssociatedToFieldLevelEncryptionConfig–The maximum number of distributions have been associated with the specified configuration for field-level encryption.
-
TooManyDistributionsAssociatedToKeyGroup–The number of distributions that reference this key group is more than the maximum allowed. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsAssociatedToOriginAccessControl–The maximum number of distributions have been associated with the specified origin access control.
For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsAssociatedToOriginRequestPolicy–The maximum number of distributions have been associated with the specified origin request policy. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsAssociatedToResponseHeadersPolicy–The maximum number of distributions have been associated with the specified response headers policy.
For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsWithFunctionAssociations–You have reached the maximum number of distributions that are associated with a CloudFront function. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyDistributionsWithLambdaAssociations–Processing your request would cause the maximum number of distributions with Lambda@Edge function associations per owner to be exceeded.
-
TooManyDistributionsWithSingleFunctionARN–The maximum number of distributions have been associated with the specified Lambda@Edge function.
-
TooManyFunctionAssociations–You have reached the maximum number of CloudFront function associations for this distribution. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyHeadersInForwardedValues–Your request contains too many headers in forwarded values.
-
TooManyKeyGroupsAssociatedToDistribution–The number of key groups referenced by this distribution is more than the maximum allowed. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyLambdaFunctionAssociations–Your request contains more Lambda@Edge function associations than are allowed per distribution.
-
TooManyOriginCustomHeaders–Your request contains too many origin custom headers.
-
TooManyOriginGroupsPerDistribution–Processing your request would cause you to exceed the maximum number of origin groups allowed.
-
TooManyOrigins–You cannot create more origins for the distribution.
-
TooManyQueryStringParameters–Your request contains too many query string parameters.
-
TooManyTrustedSigners–Your request contains more trusted signers than are allowed per distribution.
-
TrustedKeyGroupDoesNotExist–The specified key group does not exist.
-
TrustedSignerDoesNotExist–One or more of your trusted signers don't exist.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 | |