Interface BehaviorOptions
- All Superinterfaces:
AddBehaviorOptions,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
BehaviorOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:00.414Z")
@Stability(Stable)
public interface BehaviorOptions
extends software.amazon.jsii.JsiiSerializable, AddBehaviorOptions
Options for creating a new behavior.
Example:
Bucket s3Bucket;
// Add a cloudfront Function to a Distribution
Function cfFunction = Function.Builder.create(this, "Function")
.code(FunctionCode.fromInline("function handler(event) { return event.request }"))
.runtime(FunctionRuntime.JS_2_0)
.build();
Distribution.Builder.create(this, "distro")
.defaultBehavior(BehaviorOptions.builder()
.origin(new S3Origin(s3Bucket))
.functionAssociations(List.of(FunctionAssociation.builder()
.function(cfFunction)
.eventType(FunctionEventType.VIEWER_REQUEST)
.build()))
.build())
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBehaviorOptionsstatic final classAn implementation forBehaviorOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic BehaviorOptions.Builderbuilder()The origin that you want CloudFront to route requests to when they match this behavior.Methods inherited from interface software.amazon.awscdk.services.cloudfront.AddBehaviorOptions
getAllowedMethods, getCachedMethods, getCachePolicy, getCompress, getEdgeLambdas, getEnableGrpc, getFunctionAssociations, getOriginRequestPolicy, getRealtimeLogConfig, getResponseHeadersPolicy, getSmoothStreaming, getTrustedKeyGroups, getViewerProtocolPolicyMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getOrigin
The origin that you want CloudFront to route requests to when they match this behavior. -
builder
- Returns:
- a
BehaviorOptions.BuilderofBehaviorOptions
-