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.
import aws_cdk.aws_cloudfront as cloudfront
import aws_cdk.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.

Return type

LambdaEdgeEventType

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

Return type

Optional[bool]

lambda_function

A version of the lambda to associate.

Return type

IVersion