aws-cdk-lib.aws_cloudfront.CfnFunctionProps

interface CfnFunctionProps

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

Properties for defining a CfnFunction.

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';
const cfnFunctionProps: cloudfront.CfnFunctionProps = {
  functionCode: 'functionCode',
  functionConfig: {
    comment: 'comment',
    runtime: 'runtime',
  },
  name: 'name',

  // the properties below are optional
  autoPublish: false,
  functionMetadata: {
    functionArn: 'functionArn',
  },
};

Properties

NameTypeDescription
functionCodestringThe function code.
functionConfigIResolvable | FunctionConfigPropertyContains configuration information about a CloudFront function.
namestringA name to identify the function.
autoPublish?boolean | IResolvableA flag that determines whether to automatically publish the function to the LIVE stage when it’s created.
functionMetadata?IResolvable | FunctionMetadataPropertyContains metadata about a CloudFront function.

functionCode

Type: string

The function code.

For more information about writing a CloudFront function, see Writing function code for CloudFront Functions in the Amazon CloudFront Developer Guide .


functionConfig

Type: IResolvable | FunctionConfigProperty

Contains configuration information about a CloudFront function.


name

Type: string

A name to identify the function.


autoPublish?

Type: boolean | IResolvable (optional)

A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.

To automatically publish to the LIVE stage, set this property to true .


functionMetadata?

Type: IResolvable | FunctionMetadataProperty (optional)

Contains metadata about a CloudFront function.