LambdaFunctionAssociation

class aws_cdk.aws_cloudfront.LambdaFunctionAssociation(*, event_type, lambda_function, include_body=None)

Bases: object

Parameters:
ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront
from aws_cdk import aws_lambda as lambda_

# version: lambda.Version

lambda_function_association = cloudfront.LambdaFunctionAssociation(
    event_type=cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST,
    lambda_function=version,

    # the properties below are optional
    include_body=False
)

Attributes

event_type

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

include_body

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

Default:

false

lambda_function

A version of the lambda to associate.