Interface IFunctionProps
Properties for creating a CloudFront Function.
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.AWS.CloudFront.dll
Syntax (csharp)
public interface IFunctionProps
Syntax (vb)
Public Interface 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
Properties
Code | The source code of the function. |
Comment | A comment to describe the function. |
FunctionName | A name to identify the function. |
Properties
Code
Comment
A comment to describe the function.
virtual string Comment { get; }
Property Value
System.String
Remarks
Default: - same as functionName
FunctionName
A name to identify the function.
virtual string FunctionName { get; }
Property Value
System.String
Remarks
Default: - generated from the id