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

# function_ is of type 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.

Return type

FunctionEventType

function

The CloudFront function that will be invoked.

Return type

IFunction