update_cache_policy
¶
update_cache_policy(
cache_policy_config: CachePolicyConfig,
id: string,
*,
config_overrides: Optional[CloudFrontClientConfig] = 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/cloud_front.py
8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 | |