FunctionAssociation

class aws_cdk.aws_cloudfront.FunctionAssociation(*, event_type, function)

Bases: object

Represents a CloudFront function and event type when using CF Functions.

The type of the AddBehaviorOptions.functionAssociations property.

Parameters:
  • event_type (FunctionEventType) – The type of event which should invoke the function.

  • function (IFunction) – The CloudFront function that will be invoked.

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

# function_: cloudfront.Function

function_association = cloudfront.FunctionAssociation(
    event_type=cloudfront.FunctionEventType.VIEWER_REQUEST,
    function=function_
)

Attributes

event_type

The type of event which should invoke the function.

function

The CloudFront function that will be invoked.