interface EdgeLambda
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CloudFront.EdgeLambda |
Java | software.amazon.awscdk.services.cloudfront.EdgeLambda |
Python | aws_cdk.aws_cloudfront.EdgeLambda |
TypeScript (source) | @aws-cdk/aws-cloudfront » EdgeLambda |
Represents a Lambda function version and event type when using Lambda@Edge.
The type of the {@link AddBehaviorOptions.edgeLambdas} property.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cloudfront from '@aws-cdk/aws-cloudfront';
import * as lambda from '@aws-cdk/aws-lambda';
declare const version: lambda.Version;
const edgeLambda: cloudfront.EdgeLambda = {
eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST,
functionVersion: version,
// the properties below are optional
includeBody: false,
};
Properties
Name | Type | Description |
---|---|---|
event | Lambda | The type of event in response to which should the function be invoked. |
function | IVersion | The version of the Lambda function that will be invoked. |
include | boolean | Allows a Lambda function to have read access to the body content. |
eventType
Type:
Lambda
The type of event in response to which should the function be invoked.
functionVersion
Type:
IVersion
The version of the Lambda function that will be invoked.
Note: it's not possible to use the '$LATEST' function version for Lambda@Edge!
includeBody?
Type:
boolean
(optional, default: false)
Allows a Lambda function to have read access to the body content.
Only valid for "request" event types (ORIGIN_REQUEST
or VIEWER_REQUEST
).
See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html