update_distribution
¶
update_distribution(
distribution_config: DistributionConfig,
id: string,
*,
config_overrides: Optional[CloudFrontClientConfig] = None,
if_match: Optional[string] = None,
) -> UpdateDistributionResult
Updates the configuration for a CloudFront distribution.
The update process includes getting the current distribution configuration, updating it to make your changes, and then submitting an UpdateDistribution request to make the updates.
To update a web distribution using the CloudFront API
-
Use
GetDistributionConfigto get the current configuration, including the version identifier (ETag). -
Update the distribution configuration that was returned in the response. Note the following important requirements and restrictions:
-
You must copy the
ETagfield value from the response. (You'll use it for theIfMatchparameter in your request.) Then, remove theETagfield from the distribution configuration. -
You can't change the value of
CallerReference.
-
-
Submit an
UpdateDistributionrequest, providing the updated distribution configuration. The new configuration replaces the existing configuration. The values that you specify in anUpdateDistributionrequest are not merged into your existing configuration. Make sure to include all fields: the ones that you modified and also the ones that you didn't.
Parameters:
-
distribution_config(DistributionConfig) –The distribution's configuration information.
-
id(string) –The distribution's id.
-
if_match(Optional[string], default:None) –The value of the
ETagheader that you received when retrieving the distribution's configuration. For example:E2QWRUHAPOMQZL.
Raises:
-
AccessDenied–Access denied.
-
CNAMEAlreadyExists–The CNAME specified is already defined for CloudFront.
-
ContinuousDeploymentPolicyInUse–You cannot delete a continuous deployment policy that is associated with a primary distribution.
-
EntityNotFound–The entity was not found.
-
IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior–The specified configuration for field-level encryption can't be associated with the specified cache behavior.
-
IllegalOriginAccessConfiguration–An origin cannot contain both an origin access control (OAC) and an origin access identity (OAI).
-
IllegalUpdate–The update contains modifications that are not allowed.
-
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.
-
InvalidDomainNameForOriginAccessControl–An origin access control is associated with an origin whose domain name is not supported.
-
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.
-
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.
-
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.
-
NoSuchContinuousDeploymentPolicy–The continuous deployment policy doesn't 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.
-
StagingDistributionInUse–A continuous deployment policy for this staging distribution already exists.
-
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.
-
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/cloud_front.py
9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 | |