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 (IFunctionRef) – 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_ref: cloudfront.IFunctionRef

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

Attributes

event_type

The type of event which should invoke the function.

function

The CloudFront function that will be invoked.