# CfnFunctionPropsMixin

Creates a CloudFront function.

To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function, and the function’s stage.

By default, when you create a function, it’s in the `DEVELOPMENT` stage. In this stage, you can [test the function](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/test-function.html) in the CloudFront console (or with `TestFunction` in the CloudFront API).

When you’re ready to use your function with a CloudFront distribution, publish the function to the `LIVE` stage. You can do this in the CloudFront console, with `PublishFunction` in the CloudFront API, or by updating the `AWS::CloudFront::Function` resource with the `AutoPublish` property set to `true` . When the function is published to the `LIVE` stage, you can attach it to a distribution’s cache behavior, using the function’s ARN.

To automatically publish the function to the `LIVE` stage when it’s created, set the `AutoPublish` property to `true` .

Extends: [Mixin](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Mixin.html) › CfnFunctionPropsMixin
Implements: [IMixin](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.IMixin.html)

- CloudFormation: [`AWS::CloudFront::Function`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudfront-function.html)
- Source: Generated at build time
- Type last changed: v2.269.0 · 16 Sep 2026

## Initializer

TypeScript:

```ts
new CfnFunctionPropsMixin(props: CfnFunctionMixinProps, options?: CfnPropertyMixinOptions)
```

Python:

```python
CfnFunctionPropsMixin(props: CfnFunctionMixinProps, options: typing.Optional[CfnPropertyMixinOptions] = None)
```

Java:

```java
new CfnFunctionPropsMixin(CfnFunctionMixinProps props, CfnPropertyMixinOptions options)
```

C# / .NET:

```csharp
new CfnFunctionPropsMixin(CfnFunctionMixinProps props, CfnPropertyMixinOptions? options = null)
```

Golang:

```go
NewCfnFunctionPropsMixin(Props CfnFunctionMixinProps, Options CfnPropertyMixinOptions)
```

## Methods

- `applyTo(construct: IConstruct): void` — Apply the mixin properties to the construct.

- `isMixin(x: any): boolean` (static) — Checks if `x` is a Mixin.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Mixin`.

- `supports(construct: IConstruct): boolean` — Check if this mixin supports the given construct.
