1. Packages
  2. AWS
  3. API Docs
  4. cloudfront
  5. ConnectionFunction
AWS v7.16.0 published on Friday, Jan 9, 2026 by Pulumi
aws logo
AWS v7.16.0 published on Friday, Jan 9, 2026 by Pulumi

    Manages an AWS CloudFront Connection Function.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudfront.ConnectionFunction("example", {
        name: "example-connection-function",
        connectionFunctionCode: "function handler(event) { return event.request; }",
        connectionFunctionConfig: {
            runtime: "cloudfront-js-2.0",
            comment: "Example connection function",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.ConnectionFunction("example",
        name="example-connection-function",
        connection_function_code="function handler(event) { return event.request; }",
        connection_function_config={
            "runtime": "cloudfront-js-2.0",
            "comment": "Example connection function",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.NewConnectionFunction(ctx, "example", &cloudfront.ConnectionFunctionArgs{
    			Name:                   pulumi.String("example-connection-function"),
    			ConnectionFunctionCode: pulumi.String("function handler(event) { return event.request; }"),
    			ConnectionFunctionConfig: &cloudfront.ConnectionFunctionConnectionFunctionConfigArgs{
    				Runtime: pulumi.String("cloudfront-js-2.0"),
    				Comment: pulumi.String("Example connection function"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.ConnectionFunction("example", new()
        {
            Name = "example-connection-function",
            ConnectionFunctionCode = "function handler(event) { return event.request; }",
            ConnectionFunctionConfig = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigArgs
            {
                Runtime = "cloudfront-js-2.0",
                Comment = "Example connection function",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.ConnectionFunction;
    import com.pulumi.aws.cloudfront.ConnectionFunctionArgs;
    import com.pulumi.aws.cloudfront.inputs.ConnectionFunctionConnectionFunctionConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ConnectionFunction("example", ConnectionFunctionArgs.builder()
                .name("example-connection-function")
                .connectionFunctionCode("function handler(event) { return event.request; }")
                .connectionFunctionConfig(ConnectionFunctionConnectionFunctionConfigArgs.builder()
                    .runtime("cloudfront-js-2.0")
                    .comment("Example connection function")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:ConnectionFunction
        properties:
          name: example-connection-function
          connectionFunctionCode: function handler(event) { return event.request; }
          connectionFunctionConfig:
            runtime: cloudfront-js-2.0
            comment: Example connection function
    

    With Publish Enabled

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudfront.ConnectionFunction("example", {
        name: "example-connection-function",
        connectionFunctionCode: "function handler(event) { return event.request; }",
        connectionFunctionConfig: {
            runtime: "cloudfront-js-2.0",
            comment: "Example connection function",
        },
        publish: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.ConnectionFunction("example",
        name="example-connection-function",
        connection_function_code="function handler(event) { return event.request; }",
        connection_function_config={
            "runtime": "cloudfront-js-2.0",
            "comment": "Example connection function",
        },
        publish=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.NewConnectionFunction(ctx, "example", &cloudfront.ConnectionFunctionArgs{
    			Name:                   pulumi.String("example-connection-function"),
    			ConnectionFunctionCode: pulumi.String("function handler(event) { return event.request; }"),
    			ConnectionFunctionConfig: &cloudfront.ConnectionFunctionConnectionFunctionConfigArgs{
    				Runtime: pulumi.String("cloudfront-js-2.0"),
    				Comment: pulumi.String("Example connection function"),
    			},
    			Publish: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.ConnectionFunction("example", new()
        {
            Name = "example-connection-function",
            ConnectionFunctionCode = "function handler(event) { return event.request; }",
            ConnectionFunctionConfig = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigArgs
            {
                Runtime = "cloudfront-js-2.0",
                Comment = "Example connection function",
            },
            Publish = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.ConnectionFunction;
    import com.pulumi.aws.cloudfront.ConnectionFunctionArgs;
    import com.pulumi.aws.cloudfront.inputs.ConnectionFunctionConnectionFunctionConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ConnectionFunction("example", ConnectionFunctionArgs.builder()
                .name("example-connection-function")
                .connectionFunctionCode("function handler(event) { return event.request; }")
                .connectionFunctionConfig(ConnectionFunctionConnectionFunctionConfigArgs.builder()
                    .runtime("cloudfront-js-2.0")
                    .comment("Example connection function")
                    .build())
                .publish(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:ConnectionFunction
        properties:
          name: example-connection-function
          connectionFunctionCode: function handler(event) { return event.request; }
          connectionFunctionConfig:
            runtime: cloudfront-js-2.0
            comment: Example connection function
          publish: true
    

    With Key Value Store Associations

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudfront.KeyValueStore("example", {
        name: "example-kvs",
        comment: "Example key value store",
    });
    const exampleConnectionFunction = new aws.cloudfront.ConnectionFunction("example", {
        name: "example-connection-function",
        connectionFunctionCode: "function handler(event) { return event.request; }",
        connectionFunctionConfig: {
            runtime: "cloudfront-js-2.0",
            comment: "Example connection function",
            keyValueStoreAssociation: {
                keyValueStoreArn: example.arn,
            },
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.KeyValueStore("example",
        name="example-kvs",
        comment="Example key value store")
    example_connection_function = aws.cloudfront.ConnectionFunction("example",
        name="example-connection-function",
        connection_function_code="function handler(event) { return event.request; }",
        connection_function_config={
            "runtime": "cloudfront-js-2.0",
            "comment": "Example connection function",
            "key_value_store_association": {
                "key_value_store_arn": example.arn,
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cloudfront.NewKeyValueStore(ctx, "example", &cloudfront.KeyValueStoreArgs{
    			Name:    pulumi.String("example-kvs"),
    			Comment: pulumi.String("Example key value store"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfront.NewConnectionFunction(ctx, "example", &cloudfront.ConnectionFunctionArgs{
    			Name:                   pulumi.String("example-connection-function"),
    			ConnectionFunctionCode: pulumi.String("function handler(event) { return event.request; }"),
    			ConnectionFunctionConfig: &cloudfront.ConnectionFunctionConnectionFunctionConfigArgs{
    				Runtime: pulumi.String("cloudfront-js-2.0"),
    				Comment: pulumi.String("Example connection function"),
    				KeyValueStoreAssociation: &cloudfront.ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs{
    					KeyValueStoreArn: example.Arn,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.KeyValueStore("example", new()
        {
            Name = "example-kvs",
            Comment = "Example key value store",
        });
    
        var exampleConnectionFunction = new Aws.CloudFront.ConnectionFunction("example", new()
        {
            Name = "example-connection-function",
            ConnectionFunctionCode = "function handler(event) { return event.request; }",
            ConnectionFunctionConfig = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigArgs
            {
                Runtime = "cloudfront-js-2.0",
                Comment = "Example connection function",
                KeyValueStoreAssociation = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs
                {
                    KeyValueStoreArn = example.Arn,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.KeyValueStore;
    import com.pulumi.aws.cloudfront.KeyValueStoreArgs;
    import com.pulumi.aws.cloudfront.ConnectionFunction;
    import com.pulumi.aws.cloudfront.ConnectionFunctionArgs;
    import com.pulumi.aws.cloudfront.inputs.ConnectionFunctionConnectionFunctionConfigArgs;
    import com.pulumi.aws.cloudfront.inputs.ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new KeyValueStore("example", KeyValueStoreArgs.builder()
                .name("example-kvs")
                .comment("Example key value store")
                .build());
    
            var exampleConnectionFunction = new ConnectionFunction("exampleConnectionFunction", ConnectionFunctionArgs.builder()
                .name("example-connection-function")
                .connectionFunctionCode("function handler(event) { return event.request; }")
                .connectionFunctionConfig(ConnectionFunctionConnectionFunctionConfigArgs.builder()
                    .runtime("cloudfront-js-2.0")
                    .comment("Example connection function")
                    .keyValueStoreAssociation(ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs.builder()
                        .keyValueStoreArn(example.arn())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:KeyValueStore
        properties:
          name: example-kvs
          comment: Example key value store
      exampleConnectionFunction:
        type: aws:cloudfront:ConnectionFunction
        name: example
        properties:
          name: example-connection-function
          connectionFunctionCode: function handler(event) { return event.request; }
          connectionFunctionConfig:
            runtime: cloudfront-js-2.0
            comment: Example connection function
            keyValueStoreAssociation:
              keyValueStoreArn: ${example.arn}
    

    With Tags

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.cloudfront.ConnectionFunction("example", {
        name: "example-connection-function",
        connectionFunctionCode: "function handler(event) { return event.request; }",
        connectionFunctionConfig: {
            runtime: "cloudfront-js-2.0",
            comment: "Example connection function",
        },
        tags: {
            Environment: "production",
            Team: "web",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.ConnectionFunction("example",
        name="example-connection-function",
        connection_function_code="function handler(event) { return event.request; }",
        connection_function_config={
            "runtime": "cloudfront-js-2.0",
            "comment": "Example connection function",
        },
        tags={
            "Environment": "production",
            "Team": "web",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.NewConnectionFunction(ctx, "example", &cloudfront.ConnectionFunctionArgs{
    			Name:                   pulumi.String("example-connection-function"),
    			ConnectionFunctionCode: pulumi.String("function handler(event) { return event.request; }"),
    			ConnectionFunctionConfig: &cloudfront.ConnectionFunctionConnectionFunctionConfigArgs{
    				Runtime: pulumi.String("cloudfront-js-2.0"),
    				Comment: pulumi.String("Example connection function"),
    			},
    			Tags: pulumi.StringMap{
    				"Environment": pulumi.String("production"),
    				"Team":        pulumi.String("web"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.ConnectionFunction("example", new()
        {
            Name = "example-connection-function",
            ConnectionFunctionCode = "function handler(event) { return event.request; }",
            ConnectionFunctionConfig = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigArgs
            {
                Runtime = "cloudfront-js-2.0",
                Comment = "Example connection function",
            },
            Tags = 
            {
                { "Environment", "production" },
                { "Team", "web" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.ConnectionFunction;
    import com.pulumi.aws.cloudfront.ConnectionFunctionArgs;
    import com.pulumi.aws.cloudfront.inputs.ConnectionFunctionConnectionFunctionConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ConnectionFunction("example", ConnectionFunctionArgs.builder()
                .name("example-connection-function")
                .connectionFunctionCode("function handler(event) { return event.request; }")
                .connectionFunctionConfig(ConnectionFunctionConnectionFunctionConfigArgs.builder()
                    .runtime("cloudfront-js-2.0")
                    .comment("Example connection function")
                    .build())
                .tags(Map.ofEntries(
                    Map.entry("Environment", "production"),
                    Map.entry("Team", "web")
                ))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:ConnectionFunction
        properties:
          name: example-connection-function
          connectionFunctionCode: function handler(event) { return event.request; }
          connectionFunctionConfig:
            runtime: cloudfront-js-2.0
            comment: Example connection function
          tags:
            Environment: production
            Team: web
    

    Create ConnectionFunction Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ConnectionFunction(name: string, args: ConnectionFunctionArgs, opts?: CustomResourceOptions);
    @overload
    def ConnectionFunction(resource_name: str,
                           args: ConnectionFunctionArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ConnectionFunction(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           connection_function_code: Optional[str] = None,
                           connection_function_config: Optional[ConnectionFunctionConnectionFunctionConfigArgs] = None,
                           name: Optional[str] = None,
                           publish: Optional[bool] = None,
                           tags: Optional[Mapping[str, str]] = None)
    func NewConnectionFunction(ctx *Context, name string, args ConnectionFunctionArgs, opts ...ResourceOption) (*ConnectionFunction, error)
    public ConnectionFunction(string name, ConnectionFunctionArgs args, CustomResourceOptions? opts = null)
    public ConnectionFunction(String name, ConnectionFunctionArgs args)
    public ConnectionFunction(String name, ConnectionFunctionArgs args, CustomResourceOptions options)
    
    type: aws:cloudfront:ConnectionFunction
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ConnectionFunctionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ConnectionFunctionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ConnectionFunctionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ConnectionFunctionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ConnectionFunctionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var connectionFunctionResource = new Aws.CloudFront.ConnectionFunction("connectionFunctionResource", new()
    {
        ConnectionFunctionCode = "string",
        ConnectionFunctionConfig = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigArgs
        {
            Comment = "string",
            Runtime = "string",
            KeyValueStoreAssociation = new Aws.CloudFront.Inputs.ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs
            {
                KeyValueStoreArn = "string",
            },
        },
        Name = "string",
        Publish = false,
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := cloudfront.NewConnectionFunction(ctx, "connectionFunctionResource", &cloudfront.ConnectionFunctionArgs{
    	ConnectionFunctionCode: pulumi.String("string"),
    	ConnectionFunctionConfig: &cloudfront.ConnectionFunctionConnectionFunctionConfigArgs{
    		Comment: pulumi.String("string"),
    		Runtime: pulumi.String("string"),
    		KeyValueStoreAssociation: &cloudfront.ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs{
    			KeyValueStoreArn: pulumi.String("string"),
    		},
    	},
    	Name:    pulumi.String("string"),
    	Publish: pulumi.Bool(false),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var connectionFunctionResource = new ConnectionFunction("connectionFunctionResource", ConnectionFunctionArgs.builder()
        .connectionFunctionCode("string")
        .connectionFunctionConfig(ConnectionFunctionConnectionFunctionConfigArgs.builder()
            .comment("string")
            .runtime("string")
            .keyValueStoreAssociation(ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs.builder()
                .keyValueStoreArn("string")
                .build())
            .build())
        .name("string")
        .publish(false)
        .tags(Map.of("string", "string"))
        .build());
    
    connection_function_resource = aws.cloudfront.ConnectionFunction("connectionFunctionResource",
        connection_function_code="string",
        connection_function_config={
            "comment": "string",
            "runtime": "string",
            "key_value_store_association": {
                "key_value_store_arn": "string",
            },
        },
        name="string",
        publish=False,
        tags={
            "string": "string",
        })
    
    const connectionFunctionResource = new aws.cloudfront.ConnectionFunction("connectionFunctionResource", {
        connectionFunctionCode: "string",
        connectionFunctionConfig: {
            comment: "string",
            runtime: "string",
            keyValueStoreAssociation: {
                keyValueStoreArn: "string",
            },
        },
        name: "string",
        publish: false,
        tags: {
            string: "string",
        },
    });
    
    type: aws:cloudfront:ConnectionFunction
    properties:
        connectionFunctionCode: string
        connectionFunctionConfig:
            comment: string
            keyValueStoreAssociation:
                keyValueStoreArn: string
            runtime: string
        name: string
        publish: false
        tags:
            string: string
    

    ConnectionFunction Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ConnectionFunction resource accepts the following input properties:

    ConnectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    ConnectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    Name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    Publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    ConnectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    ConnectionFunctionConfig ConnectionFunctionConnectionFunctionConfigArgs
    Configuration information for the connection function. See connection_function_config below.
    Name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    Publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    connectionFunctionCode String
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    name String

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish Boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    connectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    connection_function_code str
    Code for the connection function. Maximum length is 40960 characters.
    connection_function_config ConnectionFunctionConnectionFunctionConfigArgs
    Configuration information for the connection function. See connection_function_config below.
    name str

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    connectionFunctionCode String
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig Property Map
    Configuration information for the connection function. See connection_function_config below.
    name String

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish Boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ConnectionFunction resource produces the following output properties:

    ConnectionFunctionArn string
    ARN of the connection function.
    Etag string
    ETag of the connection function.
    Id string
    The provider-assigned unique ID for this managed resource.
    LiveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    Status string
    Status of the connection function.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    ConnectionFunctionArn string
    ARN of the connection function.
    Etag string
    ETag of the connection function.
    Id string
    The provider-assigned unique ID for this managed resource.
    LiveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    Status string
    Status of the connection function.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn String
    ARN of the connection function.
    etag String
    ETag of the connection function.
    id String
    The provider-assigned unique ID for this managed resource.
    liveStageEtag String
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    status String
    Status of the connection function.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn string
    ARN of the connection function.
    etag string
    ETag of the connection function.
    id string
    The provider-assigned unique ID for this managed resource.
    liveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    status string
    Status of the connection function.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connection_function_arn str
    ARN of the connection function.
    etag str
    ETag of the connection function.
    id str
    The provider-assigned unique ID for this managed resource.
    live_stage_etag str
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    status str
    Status of the connection function.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn String
    ARN of the connection function.
    etag String
    ETag of the connection function.
    id String
    The provider-assigned unique ID for this managed resource.
    liveStageEtag String
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    status String
    Status of the connection function.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Look up Existing ConnectionFunction Resource

    Get an existing ConnectionFunction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ConnectionFunctionState, opts?: CustomResourceOptions): ConnectionFunction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            connection_function_arn: Optional[str] = None,
            connection_function_code: Optional[str] = None,
            connection_function_config: Optional[ConnectionFunctionConnectionFunctionConfigArgs] = None,
            etag: Optional[str] = None,
            live_stage_etag: Optional[str] = None,
            name: Optional[str] = None,
            publish: Optional[bool] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None) -> ConnectionFunction
    func GetConnectionFunction(ctx *Context, name string, id IDInput, state *ConnectionFunctionState, opts ...ResourceOption) (*ConnectionFunction, error)
    public static ConnectionFunction Get(string name, Input<string> id, ConnectionFunctionState? state, CustomResourceOptions? opts = null)
    public static ConnectionFunction get(String name, Output<String> id, ConnectionFunctionState state, CustomResourceOptions options)
    resources:  _:    type: aws:cloudfront:ConnectionFunction    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ConnectionFunctionArn string
    ARN of the connection function.
    ConnectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    ConnectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    Etag string
    ETag of the connection function.
    LiveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    Name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    Publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    Status string
    Status of the connection function.
    Tags Dictionary<string, string>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    ConnectionFunctionArn string
    ARN of the connection function.
    ConnectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    ConnectionFunctionConfig ConnectionFunctionConnectionFunctionConfigArgs
    Configuration information for the connection function. See connection_function_config below.
    Etag string
    ETag of the connection function.
    LiveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    Name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    Publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    Status string
    Status of the connection function.
    Tags map[string]string
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn String
    ARN of the connection function.
    connectionFunctionCode String
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    etag String
    ETag of the connection function.
    liveStageEtag String
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    name String

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish Boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    status String
    Status of the connection function.
    tags Map<String,String>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn string
    ARN of the connection function.
    connectionFunctionCode string
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig ConnectionFunctionConnectionFunctionConfig
    Configuration information for the connection function. See connection_function_config below.
    etag string
    ETag of the connection function.
    liveStageEtag string
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    name string

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    status string
    Status of the connection function.
    tags {[key: string]: string}
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connection_function_arn str
    ARN of the connection function.
    connection_function_code str
    Code for the connection function. Maximum length is 40960 characters.
    connection_function_config ConnectionFunctionConnectionFunctionConfigArgs
    Configuration information for the connection function. See connection_function_config below.
    etag str
    ETag of the connection function.
    live_stage_etag str
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    name str

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish bool
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    status str
    Status of the connection function.
    tags Mapping[str, str]
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    connectionFunctionArn String
    ARN of the connection function.
    connectionFunctionCode String
    Code for the connection function. Maximum length is 40960 characters.
    connectionFunctionConfig Property Map
    Configuration information for the connection function. See connection_function_config below.
    etag String
    ETag of the connection function.
    liveStageEtag String
    ETag of the function's LIVE stage. Will be empty if the function has not been published.
    name String

    Name for the connection function. Must be 1-64 characters and can contain letters, numbers, hyphens, and underscores. Changing this forces a new resource to be created.

    The following arguments are optional:

    publish Boolean
    Whether to publish the function to the LIVE stage after creation or update. Defaults to false.
    status String
    Status of the connection function.
    tags Map<String>
    Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    Map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Supporting Types

    ConnectionFunctionConnectionFunctionConfig, ConnectionFunctionConnectionFunctionConfigArgs

    Comment string
    Comment to describe the function.
    Runtime string
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    KeyValueStoreAssociation ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation
    Key value store associations. See key_value_store_association below.
    Comment string
    Comment to describe the function.
    Runtime string
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    KeyValueStoreAssociation ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation
    Key value store associations. See key_value_store_association below.
    comment String
    Comment to describe the function.
    runtime String
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    keyValueStoreAssociation ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation
    Key value store associations. See key_value_store_association below.
    comment string
    Comment to describe the function.
    runtime string
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    keyValueStoreAssociation ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation
    Key value store associations. See key_value_store_association below.
    comment str
    Comment to describe the function.
    runtime str
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    key_value_store_association ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation
    Key value store associations. See key_value_store_association below.
    comment String
    Comment to describe the function.
    runtime String
    Runtime environment for the function. Valid values are cloudfront-js-1.0 and cloudfront-js-2.0.
    keyValueStoreAssociation Property Map
    Key value store associations. See key_value_store_association below.

    ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociation, ConnectionFunctionConnectionFunctionConfigKeyValueStoreAssociationArgs

    KeyValueStoreArn string
    ARN of the key value store.
    KeyValueStoreArn string
    ARN of the key value store.
    keyValueStoreArn String
    ARN of the key value store.
    keyValueStoreArn string
    ARN of the key value store.
    key_value_store_arn str
    ARN of the key value store.
    keyValueStoreArn String
    ARN of the key value store.

    Import

    Using pulumi import, import CloudFront Connection Function using the function ID. For example:

    $ pulumi import aws:cloudfront/connectionFunction:ConnectionFunction example E1PA6795UKMFR9
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.16.0 published on Friday, Jan 9, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate