Show / Hide Table of Contents

Class FunctionEventType

The type of events that a CloudFront function can be invoked in response to.

Inheritance
System.Object
FunctionEventType
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class FunctionEventType : Enum
Syntax (vb)
Public NotInheritable Class FunctionEventType
    Inherits

     Enum
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

Fields

value__
VIEWER_REQUEST

The viewer-request specifies the incoming request.

VIEWER_RESPONSE

The viewer-response specifies the outgoing response.

Fields

value__

public int value__
Field Value
Type Description
System.Int32

VIEWER_REQUEST

The viewer-request specifies the incoming request.

public const FunctionEventType VIEWER_REQUEST
Field Value
Type Description
FunctionEventType

VIEWER_RESPONSE

The viewer-response specifies the outgoing response.

public const FunctionEventType VIEWER_RESPONSE
Field Value
Type Description
FunctionEventType
Back to top Generated by DocFX