EdgeLambda

class aws_cdk.aws_cloudfront.EdgeLambda(*, event_type, function_version, include_body=None)

Bases: object

Represents a Lambda function version and event type when using Lambda@Edge.

The type of the AddBehaviorOptions.edgeLambdas property.

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

edge_lambda = cloudfront.EdgeLambda(
    event_type=cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST,
    function_version=version,

    # the properties below are optional
    include_body=False
)

Attributes

event_type

The type of event in response to which should the function be invoked.

function_version

The version of the Lambda function that will be invoked.

Note: it’s not possible to use the ‘$LATEST’ function version for Lambda@Edge!

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