Show / Hide Table of Contents

Class FunctionProps

Properties for creating a CloudFront Function.

Inheritance
System.Object
FunctionProps
Implements
IFunctionProps
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.AWS.CloudFront.dll
Syntax (csharp)
public class FunctionProps : Object, IFunctionProps
Syntax (vb)
Public Class FunctionProps
    Inherits Object
    Implements IFunctionProps
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 }")
});
new Distribution(this, "distro", new DistributionProps {
    DefaultBehavior = new BehaviorOptions {
        Origin = new S3Origin(s3Bucket),
        FunctionAssociations = new [] { new FunctionAssociation {
            Function = cfFunction,
            EventType = FunctionEventType.VIEWER_REQUEST
        } }
    }
});

Synopsis

Constructors

FunctionProps()

Properties

Code

The source code of the function.

Comment

A comment to describe the function.

FunctionName

A name to identify the function.

Constructors

FunctionProps()

public FunctionProps()

Properties

Code

The source code of the function.

public FunctionCode Code { get; set; }
Property Value

FunctionCode

Comment

A comment to describe the function.

public string Comment { get; set; }
Property Value

System.String

Remarks

Default: - same as functionName

FunctionName

A name to identify the function.

public string FunctionName { get; set; }
Property Value

System.String

Remarks

Default: - generated from the id

Implements

IFunctionProps
Back to top Generated by DocFX