Interface IEdgeFunctionProps
Properties for creating a Lambda@Edge function.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront.Experimental
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IEdgeFunctionProps : IFunctionProps, IFunctionOptions, IEventInvokeConfigOptions
Syntax (vb)
Public Interface IEdgeFunctionProps
Inherits IFunctionProps, IFunctionOptions, IEventInvokeConfigOptions
Remarks
ExampleMetadata: infused
Examples
Bucket myBucket;
// A Lambda@Edge function added to default behavior of a Distribution
// and triggered on every request
var myFunc = new Experimental.EdgeFunction(this, "MyFunction", new EdgeFunctionProps {
Runtime = Runtime.NODEJS_LATEST,
Handler = "index.handler",
Code = Code.FromAsset(Join(__dirname, "lambda-handler"))
});
new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new S3Origin(myBucket),
EdgeLambdas = new [] { new EdgeLambda {
FunctionVersion = myFunc.CurrentVersion,
EventType = LambdaEdgeEventType.VIEWER_REQUEST
} }
}
});
Synopsis
Properties
StackId | The stack ID of Lambda@Edge function. |
Properties
StackId
The stack ID of Lambda@Edge function.
virtual string StackId { get; }
Property Value
System.String
Remarks
Default: - edge-lambda-stack-${region}