Show / Hide Table of Contents

Interface IBehaviorOptions

Options for creating a new behavior.

Inherited Members
IAddBehaviorOptions.AllowedMethods
IAddBehaviorOptions.CachedMethods
IAddBehaviorOptions.CachePolicy
IAddBehaviorOptions.Compress
IAddBehaviorOptions.EdgeLambdas
IAddBehaviorOptions.EnableGrpc
IAddBehaviorOptions.FunctionAssociations
IAddBehaviorOptions.OriginRequestPolicy
IAddBehaviorOptions.RealtimeLogConfig
IAddBehaviorOptions.ResponseHeadersPolicy
IAddBehaviorOptions.SmoothStreaming
IAddBehaviorOptions.TrustedKeyGroups
IAddBehaviorOptions.ViewerProtocolPolicy
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

IOrigin

Remarks

ExampleMetadata: infused

Back to top Generated by DocFX