update_cache_policy
async
¶
update_cache_policy(
cache_policy_config: CachePolicyConfig,
id: string,
*,
config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
if_match: Optional[string] = None,
) -> UpdateCachePolicyResult
Updates a cache policy configuration.
When you update a cache policy configuration, all the fields are updated with the values provided in the request. You cannot update some fields independent of others. To update a cache policy configuration:
-
Use
GetCachePolicyConfigto get the current configuration. -
Locally modify the fields in the cache policy configuration that you want to update.
-
Call
UpdateCachePolicyby providing the entire cache policy configuration, including the fields that you modified and those that you didn't.
If your minimum TTL is greater than 0, CloudFront will cache content for at least the duration specified in the cache policy's minimum TTL, even if the Cache-Control: no-cache, no-store, or private directives are present in the origin headers.
Parameters:
-
cache_policy_config(CachePolicyConfig) –A cache policy configuration.
-
id(string) –The unique identifier for the cache policy that you are updating. The identifier is returned in a cache behavior's
CachePolicyIdfield in the response toGetDistributionConfig. -
if_match(Optional[string], default:None) –The version of the cache policy that you are updating. The version is returned in the cache policy's
ETagfield in the response toGetCachePolicyConfig.
Raises:
-
AccessDenied–Access denied.
-
CachePolicyAlreadyExists–A cache policy with this name already exists. You must provide a unique name. To modify an existing cache policy, use
UpdateCachePolicy. -
IllegalUpdate–The update contains modifications that are not allowed.
-
InconsistentQuantities–The value of
Quantityand the size ofItemsdon't match. -
InvalidArgument–An argument is invalid.
-
InvalidIfMatchVersion–The
If-Matchversion is missing or not valid. -
NoSuchCachePolicy–The cache policy does not exist.
-
PreconditionFailed–The precondition in one or more of the request fields evaluated to
false. -
TooManyCookiesInCachePolicy–The number of cookies in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyHeadersInCachePolicy–The number of headers in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
TooManyQueryStringsInCachePolicy–The number of query strings in the cache policy exceeds the maximum. For more information, see Quotas (formerly known as limits) in the Amazon CloudFront Developer Guide.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 | |