Interface IBehaviorOptions
Options for creating a new behavior.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IBehaviorOptions : IAddBehaviorOptions
Syntax (vb)
Public Interface IBehaviorOptions Inherits IAddBehaviorOptions
Remarks
ExampleMetadata: infused
Examples
Bucket s3Bucket;
// Add a cloudfront Function to a Distribution
var cfFunction = new Function(this, "Function", new FunctionProps {
Code = FunctionCode.FromInline("function handler(event) { return event.request }"),
Runtime = FunctionRuntime.JS_2_0
});
new Distribution(this, "distro", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new S3Origin(s3Bucket),
FunctionAssociations = new [] { new FunctionAssociation {
Function = cfFunction,
EventType = FunctionEventType.VIEWER_REQUEST
} }
}
});
Synopsis
Properties
| Origin | The origin that you want CloudFront to route requests to when they match this behavior. |
Properties
Origin
The origin that you want CloudFront to route requests to when they match this behavior.
IOrigin Origin { get; }
Property Value
Remarks
ExampleMetadata: infused