AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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 GetCachePolicyConfig
to get the current configuration.
Locally modify the fields in the cache policy configuration that you want to update.
Call UpdateCachePolicy
by providing the entire cache policy configuration,
including the fields that you modified and those that you didn't.
For .NET Core this operation is only available in asynchronous form. Please refer to UpdateCachePolicyAsync.
Namespace: Amazon.CloudFront
Assembly: AWSSDK.CloudFront.dll
Version: 3.x.y.z
public virtual UpdateCachePolicyResponse UpdateCachePolicy( UpdateCachePolicyRequest request )
Container for the necessary parameters to execute the UpdateCachePolicy service method.
Exception | Condition |
---|---|
AccessDeniedException | Access denied. |
CachePolicyAlreadyExistsException | A cache policy with this name already exists. You must provide a unique name. To modify an existing cache policy, use UpdateCachePolicy. |
IllegalUpdateException | The update contains modifications that are not allowed. |
InconsistentQuantitiesException | The value of Quantity and the size of Items don't match. |
InvalidArgumentException | An argument is invalid. |
InvalidIfMatchVersionException | The If-Match version is missing or not valid. |
NoSuchCachePolicyException | The cache policy does not exist. |
PreconditionFailedException | The precondition in one or more of the request fields evaluated to false. |
TooManyCookiesInCachePolicyException | 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. |
TooManyHeadersInCachePolicyException | 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. |
TooManyQueryStringsInCachePolicyException | 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. |
.NET Framework:
Supported in: 4.5, 4.0, 3.5