Class CfnCachePolicy.CachePolicyConfigProperty.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.CfnCachePolicy.CachePolicyConfigProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnCachePolicy.CachePolicyConfigProperty>
- Enclosing interface:
- CfnCachePolicy.CachePolicyConfigProperty
@Stability(Stable)
public static final class CfnCachePolicy.CachePolicyConfigProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnCachePolicy.CachePolicyConfigProperty>
A builder for
CfnCachePolicy.CachePolicyConfigProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getComment()
defaultTtl
(Number defaultTtl) Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getDefaultTtl()
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getMaxTtl()
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getMinTtl()
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getName()
parametersInCacheKeyAndForwardedToOrigin
(IResolvable parametersInCacheKeyAndForwardedToOrigin) parametersInCacheKeyAndForwardedToOrigin
(CfnCachePolicy.ParametersInCacheKeyAndForwardedToOriginProperty parametersInCacheKeyAndForwardedToOrigin)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
defaultTtl
@Stability(Stable) public CfnCachePolicy.CachePolicyConfigProperty.Builder defaultTtl(Number defaultTtl) Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getDefaultTtl()
- Parameters:
defaultTtl
- The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. This parameter is required. CloudFront uses this value as the object's time to live (TTL) only when the origin does not sendCache-Control
orExpires
headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .The default value for this field is 86400 seconds (one day). If the value of
MinTTL
is more than 86400 seconds, then the default value for this field is the same as the value ofMinTTL
.- Returns:
this
-
maxTtl
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getMaxTtl()
- Parameters:
maxTtl
- The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. This parameter is required. CloudFront uses this value only when the origin sendsCache-Control
orExpires
headers with the object. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .The default value for this field is 31536000 seconds (one year). If the value of
MinTTL
orDefaultTTL
is more than 31536000 seconds, then the default value for this field is the same as the value ofDefaultTTL
.- Returns:
this
-
minTtl
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getMinTtl()
- Parameters:
minTtl
- The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. This parameter is required. For more information, see Managing How Long Content Stays in an Edge Cache (Expiration) in the Amazon CloudFront Developer Guide .- Returns:
this
-
name
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getName()
- Parameters:
name
- A unique name to identify the cache policy. This parameter is required.- Returns:
this
-
parametersInCacheKeyAndForwardedToOrigin
@Stability(Stable) public CfnCachePolicy.CachePolicyConfigProperty.Builder parametersInCacheKeyAndForwardedToOrigin(IResolvable parametersInCacheKeyAndForwardedToOrigin) Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getParametersInCacheKeyAndForwardedToOrigin()
- Parameters:
parametersInCacheKeyAndForwardedToOrigin
- The HTTP headers, cookies, and URL query strings to include in the cache key. This parameter is required. The values included in the cache key are also included in requests that CloudFront sends to the origin.- Returns:
this
-
parametersInCacheKeyAndForwardedToOrigin
@Stability(Stable) public CfnCachePolicy.CachePolicyConfigProperty.Builder parametersInCacheKeyAndForwardedToOrigin(CfnCachePolicy.ParametersInCacheKeyAndForwardedToOriginProperty parametersInCacheKeyAndForwardedToOrigin) Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getParametersInCacheKeyAndForwardedToOrigin()
- Parameters:
parametersInCacheKeyAndForwardedToOrigin
- The HTTP headers, cookies, and URL query strings to include in the cache key. This parameter is required. The values included in the cache key are also included in requests that CloudFront sends to the origin.- Returns:
this
-
comment
Sets the value ofCfnCachePolicy.CachePolicyConfigProperty.getComment()
- Parameters:
comment
- A comment to describe the cache policy. The comment cannot be longer than 128 characters.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnCachePolicy.CachePolicyConfigProperty>
- Returns:
- a new instance of
CfnCachePolicy.CachePolicyConfigProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-