# CfnConnectionFunctionProps

Properties for defining a `CfnConnectionFunction`.

Used as props by: [CfnConnectionFunction](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CfnConnectionFunction.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// 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 cfnConnectionFunctionProps: cloudfront.CfnConnectionFunctionProps = {
  connectionFunctionCode: 'connectionFunctionCode',
  connectionFunctionConfig: {
    comment: 'comment',
    runtime: 'runtime',

    // the properties below are optional
    keyValueStoreAssociations: [{
      keyValueStoreArn: 'keyValueStoreArn',
    }],
  },
  name: 'name',

  // the properties below are optional
  autoPublish: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# 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

cfn_connection_function_props = cloudfront.CfnConnectionFunctionProps(
    connection_function_code="connectionFunctionCode",
    connection_function_config=cloudfront.CfnConnectionFunction.ConnectionFunctionConfigProperty(
        comment="comment",
        runtime="runtime",

        # the properties below are optional
        key_value_store_associations=[cloudfront.CfnConnectionFunction.KeyValueStoreAssociationProperty(
            key_value_store_arn="keyValueStoreArn"
        )]
    ),
    name="name",

    # the properties below are optional
    auto_publish=False,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;

CfnConnectionFunctionProps cfnConnectionFunctionProps = CfnConnectionFunctionProps.builder()
        .connectionFunctionCode("connectionFunctionCode")
        .connectionFunctionConfig(ConnectionFunctionConfigProperty.builder()
                .comment("comment")
                .runtime("runtime")

                // the properties below are optional
                .keyValueStoreAssociations(List.of(KeyValueStoreAssociationProperty.builder()
                        .keyValueStoreArn("keyValueStoreArn")
                        .build()))
                .build())
        .name("name")

        // the properties below are optional
        .autoPublish(false)
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;

var cfnConnectionFunctionProps = new CfnConnectionFunctionProps {
    ConnectionFunctionCode = "connectionFunctionCode",
    ConnectionFunctionConfig = new ConnectionFunctionConfigProperty {
        Comment = "comment",
        Runtime = "runtime",

        // the properties below are optional
        KeyValueStoreAssociations = new [] { new KeyValueStoreAssociationProperty {
            KeyValueStoreArn = "keyValueStoreArn"
        } }
    },
    Name = "name",

    // the properties below are optional
    AutoPublish = false,
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnConnectionFunctionProps := &CfnConnectionFunctionProps{
	ConnectionFunctionCode: jsii.String("connectionFunctionCode"),
	ConnectionFunctionConfig: &ConnectionFunctionConfigProperty{
		Comment: jsii.String("comment"),
		Runtime: jsii.String("runtime"),

		// the properties below are optional
		KeyValueStoreAssociations: []interface{}{
			&KeyValueStoreAssociationProperty{
				KeyValueStoreArn: jsii.String("keyValueStoreArn"),
			},
		},
	},
	Name: jsii.String("name"),

	// the properties below are optional
	AutoPublish: jsii.Boolean(false),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `autoPublish`: boolean | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) = false — 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` .

- `connectionFunctionCode`: string (required) — The code for the connection function.

- `connectionFunctionConfig`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnConnectionFunction.ConnectionFunctionConfigProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CfnConnectionFunction.ConnectionFunctionConfigProperty.html) (required) — Contains configuration information about a CloudFront function.

- `name`: string (required) — The connection function name.

- `tags`: [CfnTag](/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — A complex type that contains zero or more `Tag` elements.
