Class CfnDistribution.CacheSettingsProperty.Builder
java.lang.Object
software.amazon.awscdk.services.lightsail.CfnDistribution.CacheSettingsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnDistribution.CacheSettingsProperty>
- Enclosing interface:
CfnDistribution.CacheSettingsProperty
@Stability(Stable)
public static final class CfnDistribution.CacheSettingsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnDistribution.CacheSettingsProperty>
A builder for
CfnDistribution.CacheSettingsProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedHttpMethods
(String allowedHttpMethods) Sets the value ofCfnDistribution.CacheSettingsProperty.getAllowedHttpMethods()
build()
Builds the configured instance.cachedHttpMethods
(String cachedHttpMethods) Sets the value ofCfnDistribution.CacheSettingsProperty.getCachedHttpMethods()
defaultTtl
(Number defaultTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getDefaultTtl()
forwardedCookies
(IResolvable forwardedCookies) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedCookies()
forwardedCookies
(CfnDistribution.CookieObjectProperty forwardedCookies) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedCookies()
forwardedHeaders
(IResolvable forwardedHeaders) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedHeaders()
forwardedHeaders
(CfnDistribution.HeaderObjectProperty forwardedHeaders) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedHeaders()
forwardedQueryStrings
(IResolvable forwardedQueryStrings) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedQueryStrings()
forwardedQueryStrings
(CfnDistribution.QueryStringObjectProperty forwardedQueryStrings) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedQueryStrings()
maximumTtl
(Number maximumTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getMaximumTtl()
minimumTtl
(Number minimumTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getMinimumTtl()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowedHttpMethods
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder allowedHttpMethods(String allowedHttpMethods) Sets the value ofCfnDistribution.CacheSettingsProperty.getAllowedHttpMethods()
- Parameters:
allowedHttpMethods
- The HTTP methods that are processed and forwarded to the distribution's origin. You can specify the following options:GET,HEAD
- The distribution forwards theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution forwards theGET
,HEAD
, andOPTIONS
methods.GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
- The distribution forwards theGET
,HEAD
,OPTIONS
,PUT
,PATCH
,POST
, andDELETE
methods.
If you specify
GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE
, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin.- Returns:
this
-
cachedHttpMethods
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder cachedHttpMethods(String cachedHttpMethods) Sets the value ofCfnDistribution.CacheSettingsProperty.getCachedHttpMethods()
- Parameters:
cachedHttpMethods
- The HTTP method responses that are cached by your distribution. You can specify the following options:GET,HEAD
- The distribution caches responses to theGET
andHEAD
methods.GET,HEAD,OPTIONS
- The distribution caches responses to theGET
,HEAD
, andOPTIONS
methods.
- Returns:
this
-
defaultTtl
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder defaultTtl(Number defaultTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getDefaultTtl()
- Parameters:
defaultTtl
- The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated.The value specified applies only when the origin does not add HTTP headers such as
Cache-Control max-age
,Cache-Control s-maxage
, andExpires
to objects.- Returns:
this
-
forwardedCookies
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedCookies(IResolvable forwardedCookies) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedCookies()
- Parameters:
forwardedCookies
- An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.- Returns:
this
-
forwardedCookies
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedCookies(CfnDistribution.CookieObjectProperty forwardedCookies) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedCookies()
- Parameters:
forwardedCookies
- An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded.- Returns:
this
-
forwardedHeaders
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedHeaders(IResolvable forwardedHeaders) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedHeaders()
- Parameters:
forwardedHeaders
- An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.- Returns:
this
-
forwardedHeaders
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedHeaders(CfnDistribution.HeaderObjectProperty forwardedHeaders) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedHeaders()
- Parameters:
forwardedHeaders
- An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded.- Returns:
this
-
forwardedQueryStrings
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedQueryStrings(IResolvable forwardedQueryStrings) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedQueryStrings()
- Parameters:
forwardedQueryStrings
- An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.- Returns:
this
-
forwardedQueryStrings
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder forwardedQueryStrings(CfnDistribution.QueryStringObjectProperty forwardedQueryStrings) Sets the value ofCfnDistribution.CacheSettingsProperty.getForwardedQueryStrings()
- Parameters:
forwardedQueryStrings
- An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded.- Returns:
this
-
maximumTtl
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder maximumTtl(Number maximumTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getMaximumTtl()
- Parameters:
maximumTtl
- The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. The value specified applies only when the origin adds HTTP headers such asCache-Control max-age
,Cache-Control s-maxage
, andExpires
to objects.- Returns:
this
-
minimumTtl
@Stability(Stable) public CfnDistribution.CacheSettingsProperty.Builder minimumTtl(Number minimumTtl) Sets the value ofCfnDistribution.CacheSettingsProperty.getMinimumTtl()
- Parameters:
minimumTtl
- The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. A value of0
must be specified forminimumTTL
if the distribution is configured to forward all headers to the origin.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnDistribution.CacheSettingsProperty>
- Returns:
- a new instance of
CfnDistribution.CacheSettingsProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-