Class Behavior.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.Behavior.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<Behavior>
- Enclosing interface:
Behavior
@Stability(Stable)
public static final class Behavior.Builder
extends Object
implements software.amazon.jsii.Builder<Behavior>
A builder for
Behavior
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedMethods
(CloudFrontAllowedMethods allowedMethods) Sets the value ofBehavior.getAllowedMethods()
build()
Builds the configured instance.cachedMethods
(CloudFrontAllowedCachedMethods cachedMethods) Sets the value ofBehavior.getCachedMethods()
Sets the value ofBehavior.getCompress()
defaultTtl
(Duration defaultTtl) Sets the value ofBehavior.getDefaultTtl()
forwardedValues
(CfnDistribution.ForwardedValuesProperty forwardedValues) Sets the value ofBehavior.getForwardedValues()
functionAssociations
(List<? extends FunctionAssociation> functionAssociations) Sets the value ofBehavior.getFunctionAssociations()
isDefaultBehavior
(Boolean isDefaultBehavior) Sets the value ofBehavior.getIsDefaultBehavior()
lambdaFunctionAssociations
(List<? extends LambdaFunctionAssociation> lambdaFunctionAssociations) Sets the value ofBehavior.getLambdaFunctionAssociations()
Sets the value ofBehavior.getMaxTtl()
Sets the value ofBehavior.getMinTtl()
pathPattern
(String pathPattern) Sets the value ofBehavior.getPathPattern()
trustedKeyGroups
(List<? extends IKeyGroup> trustedKeyGroups) Sets the value ofBehavior.getTrustedKeyGroups()
trustedSigners
(List<String> trustedSigners) Deprecated.- We recommend using trustedKeyGroups instead of trustedSigners.viewerProtocolPolicy
(ViewerProtocolPolicy viewerProtocolPolicy) Sets the value ofBehavior.getViewerProtocolPolicy()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowedMethods
Sets the value ofBehavior.getAllowedMethods()
- Parameters:
allowedMethods
- The method this CloudFront distribution responds do.- Returns:
this
-
cachedMethods
@Stability(Stable) public Behavior.Builder cachedMethods(CloudFrontAllowedCachedMethods cachedMethods) Sets the value ofBehavior.getCachedMethods()
- Parameters:
cachedMethods
- Which methods are cached by CloudFront by default.- Returns:
this
-
compress
Sets the value ofBehavior.getCompress()
- Parameters:
compress
- If CloudFront should automatically compress some content types.- Returns:
this
-
defaultTtl
Sets the value ofBehavior.getDefaultTtl()
- Parameters:
defaultTtl
- The default amount of time CloudFront will cache an object. This value applies only when your custom origin does not add HTTP headers, such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.- Returns:
this
-
forwardedValues
@Stability(Stable) public Behavior.Builder forwardedValues(CfnDistribution.ForwardedValuesProperty forwardedValues) Sets the value ofBehavior.getForwardedValues()
- Parameters:
forwardedValues
- The values CloudFront will forward to the origin when making a request.- Returns:
this
-
functionAssociations
@Stability(Stable) public Behavior.Builder functionAssociations(List<? extends FunctionAssociation> functionAssociations) Sets the value ofBehavior.getFunctionAssociations()
- Parameters:
functionAssociations
- The CloudFront functions to invoke before serving the contents.- Returns:
this
-
isDefaultBehavior
Sets the value ofBehavior.getIsDefaultBehavior()
- Parameters:
isDefaultBehavior
- If this behavior is the default behavior for the distribution. You must specify exactly one default distribution per CloudFront distribution. The default behavior is allowed to omit the "path" property.- Returns:
this
-
lambdaFunctionAssociations
@Stability(Stable) public Behavior.Builder lambdaFunctionAssociations(List<? extends LambdaFunctionAssociation> lambdaFunctionAssociations) Sets the value ofBehavior.getLambdaFunctionAssociations()
- Parameters:
lambdaFunctionAssociations
- Declares associated lambda@edge functions for this distribution behaviour.- Returns:
this
-
maxTtl
Sets the value ofBehavior.getMaxTtl()
- Parameters:
maxTtl
- The max amount of time you want objects to stay in the cache before CloudFront queries your origin.- Returns:
this
-
minTtl
Sets the value ofBehavior.getMinTtl()
- Parameters:
minTtl
- The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.- Returns:
this
-
pathPattern
Sets the value ofBehavior.getPathPattern()
- Parameters:
pathPattern
- The path this behavior responds to. Required for all non-default behaviors. (The default behavior implicitly has "*" as the path pattern. )- Returns:
this
-
trustedKeyGroups
@Stability(Stable) public Behavior.Builder trustedKeyGroups(List<? extends IKeyGroup> trustedKeyGroups) Sets the value ofBehavior.getTrustedKeyGroups()
- Parameters:
trustedKeyGroups
- A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.- Returns:
this
-
trustedSigners
@Stability(Deprecated) @Deprecated public Behavior.Builder trustedSigners(List<String> trustedSigners) Deprecated.- We recommend using trustedKeyGroups instead of trustedSigners.Sets the value ofBehavior.getTrustedSigners()
- Parameters:
trustedSigners
- Trusted signers is how CloudFront allows you to serve private content. The signers are the account IDs that are allowed to sign cookies/presigned URLs for this distribution.If you pass a non empty value, all requests for this behavior must be signed (no public access will be allowed)
- Returns:
this
-
viewerProtocolPolicy
@Stability(Stable) public Behavior.Builder viewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy) Sets the value ofBehavior.getViewerProtocolPolicy()
- Parameters:
viewerProtocolPolicy
- The viewer policy for this behavior.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<Behavior>
- Returns:
- a new instance of
Behavior
- Throws:
NullPointerException
- if any required attribute was not provided
-