Class AddBehaviorOptions.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.AddBehaviorOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AddBehaviorOptions>
- Enclosing interface:
AddBehaviorOptions
@Stability(Stable)
public static final class AddBehaviorOptions.Builder
extends Object
implements software.amazon.jsii.Builder<AddBehaviorOptions>
A builder for
AddBehaviorOptions-
Constructor Summary
Constructors -
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(ICachePolicyRef cachePolicy) Sets the value ofAddBehaviorOptions.getCachePolicy()Sets the value ofAddBehaviorOptions.getCompress()edgeLambdas(List<? extends EdgeLambda> edgeLambdas) Sets the value ofAddBehaviorOptions.getEdgeLambdas()enableGrpc(Boolean enableGrpc) Sets the value ofAddBehaviorOptions.getEnableGrpc()functionAssociations(List<? extends FunctionAssociation> functionAssociations) Sets the value ofAddBehaviorOptions.getFunctionAssociations()originRequestPolicy(IOriginRequestPolicyRef originRequestPolicy) Sets the value ofAddBehaviorOptions.getOriginRequestPolicy()realtimeLogConfig(IRealtimeLogConfigRef realtimeLogConfig) Sets the value ofAddBehaviorOptions.getRealtimeLogConfig()responseHeadersPolicy(IResponseHeadersPolicyRef responseHeadersPolicy) Sets the value ofAddBehaviorOptions.getResponseHeadersPolicy()smoothStreaming(Boolean smoothStreaming) Sets the value ofAddBehaviorOptions.getSmoothStreaming()trustedKeyGroups(List<? extends IKeyGroupRef> trustedKeyGroups) Sets the value ofAddBehaviorOptions.getTrustedKeyGroups()viewerProtocolPolicy(ViewerProtocolPolicy viewerProtocolPolicy) Sets the value ofAddBehaviorOptions.getViewerProtocolPolicy()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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 AddBehaviorOptions.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
-
enableGrpc
Sets the value ofAddBehaviorOptions.getEnableGrpc()- Parameters:
enableGrpc- Enables your CloudFront distribution to receive gRPC requests and to proxy them directly to your origins. If theenableGrpcis set to true, the following restrictions apply:- The
allowedMethodsproperty must beAllowedMethods.ALLOW_ALLto include POST method because gRPC only supports POST method. - The
httpVersionproperty must beHttpVersion.HTTP2orHttpVersion.HTTP2_AND_3because gRPC only supports versions including HTTP/2. - The
edgeLambdasproperty can't be specified because gRPC is not supported with Lambda@Edge.
- The
- Returns:
this
-
functionAssociations
@Stability(Stable) public AddBehaviorOptions.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 AddBehaviorOptions.Builder originRequestPolicy(IOriginRequestPolicyRef 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
-
realtimeLogConfig
@Stability(Stable) public AddBehaviorOptions.Builder realtimeLogConfig(IRealtimeLogConfigRef realtimeLogConfig) Sets the value ofAddBehaviorOptions.getRealtimeLogConfig()- Parameters:
realtimeLogConfig- The real-time log configuration to be attached to this cache behavior.- Returns:
this
-
responseHeadersPolicy
@Stability(Stable) public AddBehaviorOptions.Builder responseHeadersPolicy(IResponseHeadersPolicyRef 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 AddBehaviorOptions.Builder trustedKeyGroups(List<? extends IKeyGroupRef> 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 AddBehaviorOptions.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:
buildin interfacesoftware.amazon.jsii.Builder<AddBehaviorOptions>- Returns:
- a new instance of
AddBehaviorOptions - Throws:
NullPointerException- if any required attribute was not provided
-