Class BehaviorOptions.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.BehaviorOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BehaviorOptions>
- Enclosing interface:
BehaviorOptions
@Stability(Stable)
public static final class BehaviorOptions.Builder
extends Object
implements software.amazon.jsii.Builder<BehaviorOptions>
A builder for
BehaviorOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedMethods
(AllowedMethods allowedMethods) Sets the value ofAddBehaviorOptions.getAllowedMethods()
build()
Builds the configured instance.cachedMethods
(CachedMethods cachedMethods) Sets the value ofAddBehaviorOptions.getCachedMethods()
cachePolicy
(ICachePolicy cachePolicy) Sets the value ofAddBehaviorOptions.getCachePolicy()
Sets the value ofAddBehaviorOptions.getCompress()
edgeLambdas
(List<? extends EdgeLambda> edgeLambdas) Sets the value ofAddBehaviorOptions.getEdgeLambdas()
functionAssociations
(List<? extends FunctionAssociation> functionAssociations) Sets the value ofAddBehaviorOptions.getFunctionAssociations()
Sets the value ofBehaviorOptions.getOrigin()
originRequestPolicy
(IOriginRequestPolicy originRequestPolicy) Sets the value ofAddBehaviorOptions.getOriginRequestPolicy()
responseHeadersPolicy
(IResponseHeadersPolicy responseHeadersPolicy) Sets the value ofAddBehaviorOptions.getResponseHeadersPolicy()
smoothStreaming
(Boolean smoothStreaming) Sets the value ofAddBehaviorOptions.getSmoothStreaming()
trustedKeyGroups
(List<? extends IKeyGroup> trustedKeyGroups) Sets the value ofAddBehaviorOptions.getTrustedKeyGroups()
viewerProtocolPolicy
(ViewerProtocolPolicy viewerProtocolPolicy) Sets the value ofAddBehaviorOptions.getViewerProtocolPolicy()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
origin
Sets the value ofBehaviorOptions.getOrigin()
- Parameters:
origin
- The origin that you want CloudFront to route requests to when they match this behavior. This parameter is required.- Returns:
this
-
allowedMethods
Sets the value ofAddBehaviorOptions.getAllowedMethods()
- Parameters:
allowedMethods
- HTTP methods to allow for this behavior.- Returns:
this
-
cachedMethods
Sets the value ofAddBehaviorOptions.getCachedMethods()
- Parameters:
cachedMethods
- HTTP methods to cache for this behavior.- Returns:
this
-
cachePolicy
Sets the value ofAddBehaviorOptions.getCachePolicy()
- Parameters:
cachePolicy
- The cache policy for this behavior. The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache.- Returns:
this
-
compress
Sets the value ofAddBehaviorOptions.getCompress()
- Parameters:
compress
- Whether you want CloudFront to automatically compress certain files for this cache behavior. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress.- Returns:
this
-
edgeLambdas
@Stability(Stable) public BehaviorOptions.Builder edgeLambdas(List<? extends EdgeLambda> edgeLambdas) Sets the value ofAddBehaviorOptions.getEdgeLambdas()
- Parameters:
edgeLambdas
- The Lambda@Edge functions to invoke before serving the contents.- Returns:
this
-
functionAssociations
@Stability(Stable) public BehaviorOptions.Builder functionAssociations(List<? extends FunctionAssociation> functionAssociations) Sets the value ofAddBehaviorOptions.getFunctionAssociations()
- Parameters:
functionAssociations
- The CloudFront functions to invoke before serving the contents.- Returns:
this
-
originRequestPolicy
@Stability(Stable) public BehaviorOptions.Builder originRequestPolicy(IOriginRequestPolicy originRequestPolicy) Sets the value ofAddBehaviorOptions.getOriginRequestPolicy()
- Parameters:
originRequestPolicy
- The origin request policy for this behavior. The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin.- Returns:
this
-
responseHeadersPolicy
@Stability(Stable) public BehaviorOptions.Builder responseHeadersPolicy(IResponseHeadersPolicy responseHeadersPolicy) Sets the value ofAddBehaviorOptions.getResponseHeadersPolicy()
- Parameters:
responseHeadersPolicy
- The response headers policy for this behavior. The response headers policy determines which headers are included in responses- Returns:
this
-
smoothStreaming
Sets the value ofAddBehaviorOptions.getSmoothStreaming()
- Parameters:
smoothStreaming
- Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.- Returns:
this
-
trustedKeyGroups
@Stability(Stable) public BehaviorOptions.Builder trustedKeyGroups(List<? extends IKeyGroup> trustedKeyGroups) Sets the value ofAddBehaviorOptions.getTrustedKeyGroups()
- Parameters:
trustedKeyGroups
- A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.- Returns:
this
-
viewerProtocolPolicy
@Stability(Stable) public BehaviorOptions.Builder viewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy) Sets the value ofAddBehaviorOptions.getViewerProtocolPolicy()
- Parameters:
viewerProtocolPolicy
- The protocol that viewers can use to access the files controlled by this behavior.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<BehaviorOptions>
- Returns:
- a new instance of
BehaviorOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-