aws-cdk-lib.aws_cloudfront.FunctionAssociation

interface FunctionAssociation

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.FunctionAssociation
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#FunctionAssociation
Javasoftware.amazon.awscdk.services.cloudfront.FunctionAssociation
Pythonaws_cdk.aws_cloudfront.FunctionAssociation
TypeScript (source)aws-cdk-lib » aws_cloudfront » FunctionAssociation

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

The type of the AddBehaviorOptions.functionAssociations property.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';

declare const function_: cloudfront.Function;
const functionAssociation: cloudfront.FunctionAssociation = {
  eventType: cloudfront.FunctionEventType.VIEWER_REQUEST,
  function: function_,
};

Properties

NameTypeDescription
eventTypeFunctionEventTypeThe type of event which should invoke the function.
functionIFunctionThe CloudFront function that will be invoked.

eventType

Type: FunctionEventType

The type of event which should invoke the function.


function

Type: IFunction

The CloudFront function that will be invoked.