1. Packages
  2. Snowflake Provider
  3. API Docs
  4. PrimaryConnection
Snowflake v2.12.0 published on Friday, Feb 13, 2026 by Pulumi
snowflake logo
Snowflake v2.12.0 published on Friday, Feb 13, 2026 by Pulumi

    Resource used to manage primary connections. For managing replicated connection check resource snowflake_secondary_connection. For more information, check connection documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    //# Minimal
    const basic = new snowflake.PrimaryConnection("basic", {name: "connection_name"});
    //# Complete (with every optional set)
    const complete = new snowflake.PrimaryConnection("complete", {
        name: "connection_name",
        comment: "my complete connection",
        enableFailoverToAccounts: ["\"<secondary_account_organization_name>\".\"<secondary_account_name>\""],
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    ## Minimal
    basic = snowflake.PrimaryConnection("basic", name="connection_name")
    ## Complete (with every optional set)
    complete = snowflake.PrimaryConnection("complete",
        name="connection_name",
        comment="my complete connection",
        enable_failover_to_accounts=["\"<secondary_account_organization_name>\".\"<secondary_account_name>\""])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/v2/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// # Minimal
    		_, err := snowflake.NewPrimaryConnection(ctx, "basic", &snowflake.PrimaryConnectionArgs{
    			Name: pulumi.String("connection_name"),
    		})
    		if err != nil {
    			return err
    		}
    		// # Complete (with every optional set)
    		_, err = snowflake.NewPrimaryConnection(ctx, "complete", &snowflake.PrimaryConnectionArgs{
    			Name:    pulumi.String("connection_name"),
    			Comment: pulumi.String("my complete connection"),
    			EnableFailoverToAccounts: pulumi.StringArray{
    				pulumi.String("\"<secondary_account_organization_name>\".\"<secondary_account_name>\""),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        //# Minimal
        var basic = new Snowflake.PrimaryConnection("basic", new()
        {
            Name = "connection_name",
        });
    
        //# Complete (with every optional set)
        var complete = new Snowflake.PrimaryConnection("complete", new()
        {
            Name = "connection_name",
            Comment = "my complete connection",
            EnableFailoverToAccounts = new[]
            {
                "\"<secondary_account_organization_name>\".\"<secondary_account_name>\"",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.PrimaryConnection;
    import com.pulumi.snowflake.PrimaryConnectionArgs;
    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) {
            //# Minimal
            var basic = new PrimaryConnection("basic", PrimaryConnectionArgs.builder()
                .name("connection_name")
                .build());
    
            //# Complete (with every optional set)
            var complete = new PrimaryConnection("complete", PrimaryConnectionArgs.builder()
                .name("connection_name")
                .comment("my complete connection")
                .enableFailoverToAccounts("\"<secondary_account_organization_name>\".\"<secondary_account_name>\"")
                .build());
    
        }
    }
    
    resources:
      ## Minimal
      basic:
        type: snowflake:PrimaryConnection
        properties:
          name: connection_name
      ## Complete (with every optional set)
      complete:
        type: snowflake:PrimaryConnection
        properties:
          name: connection_name
          comment: my complete connection
          enableFailoverToAccounts:
            - '"<secondary_account_organization_name>"."<secondary_account_name>"'
    

    Note Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult identifiers guide.

    Note This resource cannot be dropped when it has any dependent secondary connections. If you want to drop the primary connection, you must first drop all secondary connections that depend on it or promote other connection to be primary. The first option may need to be done in two steps (terraform applies): first remove all secondary connections, then primary ones. Snowflake needs some time to register the primary connection doesn’t have any dependent connections and is safe for removal. The second option may require removing the resource from the state and removing it manually from Snowflake.

    Note To demote snowflake.PrimaryConnection to snowflake.SecondaryConnection, resources need to be migrated manually. For guidance on removing and importing resources into the state check resource migration. Remove the resource from the state with terraform state rm, then recreate it in manually using: CREATE CONNECTION <name> AS REPLICA OF <organization_name>.<account_name>.<connection_name>; and then import it as the snowflake.SecondaryConnection.

    Note If a field has a default value, it is shown next to the type in the schema.

    Create PrimaryConnection Resource

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

    Constructor syntax

    new PrimaryConnection(name: string, args?: PrimaryConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def PrimaryConnection(resource_name: str,
                          args: Optional[PrimaryConnectionArgs] = None,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def PrimaryConnection(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          comment: Optional[str] = None,
                          enable_failover_to_accounts: Optional[Sequence[str]] = None,
                          name: Optional[str] = None)
    func NewPrimaryConnection(ctx *Context, name string, args *PrimaryConnectionArgs, opts ...ResourceOption) (*PrimaryConnection, error)
    public PrimaryConnection(string name, PrimaryConnectionArgs? args = null, CustomResourceOptions? opts = null)
    public PrimaryConnection(String name, PrimaryConnectionArgs args)
    public PrimaryConnection(String name, PrimaryConnectionArgs args, CustomResourceOptions options)
    
    type: snowflake:PrimaryConnection
    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 PrimaryConnectionArgs
    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 PrimaryConnectionArgs
    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 PrimaryConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PrimaryConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PrimaryConnectionArgs
    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 primaryConnectionResource = new Snowflake.PrimaryConnection("primaryConnectionResource", new()
    {
        Comment = "string",
        EnableFailoverToAccounts = new[]
        {
            "string",
        },
        Name = "string",
    });
    
    example, err := snowflake.NewPrimaryConnection(ctx, "primaryConnectionResource", &snowflake.PrimaryConnectionArgs{
    	Comment: pulumi.String("string"),
    	EnableFailoverToAccounts: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    })
    
    var primaryConnectionResource = new PrimaryConnection("primaryConnectionResource", PrimaryConnectionArgs.builder()
        .comment("string")
        .enableFailoverToAccounts("string")
        .name("string")
        .build());
    
    primary_connection_resource = snowflake.PrimaryConnection("primaryConnectionResource",
        comment="string",
        enable_failover_to_accounts=["string"],
        name="string")
    
    const primaryConnectionResource = new snowflake.PrimaryConnection("primaryConnectionResource", {
        comment: "string",
        enableFailoverToAccounts: ["string"],
        name: "string",
    });
    
    type: snowflake:PrimaryConnection
    properties:
        comment: string
        enableFailoverToAccounts:
            - string
        name: string
    

    PrimaryConnection 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 PrimaryConnection resource accepts the following input properties:

    Comment string
    Specifies a comment for the connection.
    EnableFailoverToAccounts List<string>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    Name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    Comment string
    Specifies a comment for the connection.
    EnableFailoverToAccounts []string
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    Name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment String
    Specifies a comment for the connection.
    enableFailoverToAccounts List<String>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    name String
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment string
    Specifies a comment for the connection.
    enableFailoverToAccounts string[]
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment str
    Specifies a comment for the connection.
    enable_failover_to_accounts Sequence[str]
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    name str
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    comment String
    Specifies a comment for the connection.
    enableFailoverToAccounts List<String>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    name String
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".

    Outputs

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

    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsPrimary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    ShowOutputs List<PrimaryConnectionShowOutput>
    Outputs the result of SHOW CONNECTIONS for the given connection.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsPrimary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    ShowOutputs []PrimaryConnectionShowOutput
    Outputs the result of SHOW CONNECTIONS for the given connection.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    isPrimary Boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    showOutputs List<PrimaryConnectionShowOutput>
    Outputs the result of SHOW CONNECTIONS for the given connection.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    id string
    The provider-assigned unique ID for this managed resource.
    isPrimary boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    showOutputs PrimaryConnectionShowOutput[]
    Outputs the result of SHOW CONNECTIONS for the given connection.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    id str
    The provider-assigned unique ID for this managed resource.
    is_primary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    show_outputs Sequence[PrimaryConnectionShowOutput]
    Outputs the result of SHOW CONNECTIONS for the given connection.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    isPrimary Boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    showOutputs List<Property Map>
    Outputs the result of SHOW CONNECTIONS for the given connection.

    Look up Existing PrimaryConnection Resource

    Get an existing PrimaryConnection 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?: PrimaryConnectionState, opts?: CustomResourceOptions): PrimaryConnection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            enable_failover_to_accounts: Optional[Sequence[str]] = None,
            fully_qualified_name: Optional[str] = None,
            is_primary: Optional[bool] = None,
            name: Optional[str] = None,
            show_outputs: Optional[Sequence[PrimaryConnectionShowOutputArgs]] = None) -> PrimaryConnection
    func GetPrimaryConnection(ctx *Context, name string, id IDInput, state *PrimaryConnectionState, opts ...ResourceOption) (*PrimaryConnection, error)
    public static PrimaryConnection Get(string name, Input<string> id, PrimaryConnectionState? state, CustomResourceOptions? opts = null)
    public static PrimaryConnection get(String name, Output<String> id, PrimaryConnectionState state, CustomResourceOptions options)
    resources:  _:    type: snowflake:PrimaryConnection    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:
    Comment string
    Specifies a comment for the connection.
    EnableFailoverToAccounts List<string>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    IsPrimary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    Name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs List<PrimaryConnectionShowOutput>
    Outputs the result of SHOW CONNECTIONS for the given connection.
    Comment string
    Specifies a comment for the connection.
    EnableFailoverToAccounts []string
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    IsPrimary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    Name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    ShowOutputs []PrimaryConnectionShowOutputArgs
    Outputs the result of SHOW CONNECTIONS for the given connection.
    comment String
    Specifies a comment for the connection.
    enableFailoverToAccounts List<String>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    isPrimary Boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    name String
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<PrimaryConnectionShowOutput>
    Outputs the result of SHOW CONNECTIONS for the given connection.
    comment string
    Specifies a comment for the connection.
    enableFailoverToAccounts string[]
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    isPrimary boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    name string
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs PrimaryConnectionShowOutput[]
    Outputs the result of SHOW CONNECTIONS for the given connection.
    comment str
    Specifies a comment for the connection.
    enable_failover_to_accounts Sequence[str]
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    is_primary bool
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    name str
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    show_outputs Sequence[PrimaryConnectionShowOutputArgs]
    Outputs the result of SHOW CONNECTIONS for the given connection.
    comment String
    Specifies a comment for the connection.
    enableFailoverToAccounts List<String>
    Enables failover for given connection to provided accounts. Specifies a list of accounts in your organization where a secondary connection for this primary connection can be promoted to serve as the primary connection. Include your organization name for each account in the list. For more information about this resource, see docs.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    isPrimary Boolean
    Indicates if the connection is primary. When Terraform detects that the connection is not primary, the resource is recreated.
    name String
    String that specifies the identifier (i.e. name) for the connection. Must start with an alphabetic character and may only contain letters, decimal digits (0-9), and underscores (*). For a primary connection, the name must be unique across connection names and account names in the organization. Due to technical limitations (read more here), avoid using the following characters: |, ., ".
    showOutputs List<Property Map>
    Outputs the result of SHOW CONNECTIONS for the given connection.

    Supporting Types

    PrimaryConnectionShowOutput, PrimaryConnectionShowOutputArgs

    Import

    $ pulumi import snowflake:index/primaryConnection:PrimaryConnection example '"<primary_connection_name>"'
    

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

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v2.12.0 published on Friday, Feb 13, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate