aws-cdk-lib.aws_cloudfront.LambdaFunctionAssociation

interface LambdaFunctionAssociation

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.LambdaFunctionAssociation
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#LambdaFunctionAssociation
Javasoftware.amazon.awscdk.services.cloudfront.LambdaFunctionAssociation
Pythonaws_cdk.aws_cloudfront.LambdaFunctionAssociation
TypeScript (source)aws-cdk-lib » aws_cloudfront » LambdaFunctionAssociation

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const version: lambda.Version;
const lambdaFunctionAssociation: cloudfront.LambdaFunctionAssociation = {
  eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST,
  lambdaFunction: version,

  // the properties below are optional
  includeBody: false,
};

Properties

NameTypeDescription
eventTypeLambdaEdgeEventTypeThe lambda event type defines at which event the lambda is called during the request lifecycle.
lambdaFunctionIVersionA version of the lambda to associate.
includeBody?booleanAllows a Lambda function to have read access to the body content.

eventType

Type: LambdaEdgeEventType

The lambda event type defines at which event the lambda is called during the request lifecycle.


lambdaFunction

Type: IVersion

A version of the lambda to associate.


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