Resource used to manage secondary (replicated) connections. To manage primary connection check resource snowflake_primary_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.SecondaryConnection("basic", {
name: "connection_name",
asReplicaOf: "\"<organization_name>\".\"<account_name>\".\"<connection_name>\"",
});
//# Complete (with every optional set)
const complete = new snowflake.SecondaryConnection("complete", {
name: "connection_name",
asReplicaOf: "\"<organization_name>\".\"<account_name>\".\"<connection_name>\"",
comment: "my complete secondary connection",
});
import pulumi
import pulumi_snowflake as snowflake
## Minimal
basic = snowflake.SecondaryConnection("basic",
name="connection_name",
as_replica_of="\"<organization_name>\".\"<account_name>\".\"<connection_name>\"")
## Complete (with every optional set)
complete = snowflake.SecondaryConnection("complete",
name="connection_name",
as_replica_of="\"<organization_name>\".\"<account_name>\".\"<connection_name>\"",
comment="my complete secondary connection")
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.NewSecondaryConnection(ctx, "basic", &snowflake.SecondaryConnectionArgs{
Name: pulumi.String("connection_name"),
AsReplicaOf: pulumi.String("\"<organization_name>\".\"<account_name>\".\"<connection_name>\""),
})
if err != nil {
return err
}
// # Complete (with every optional set)
_, err = snowflake.NewSecondaryConnection(ctx, "complete", &snowflake.SecondaryConnectionArgs{
Name: pulumi.String("connection_name"),
AsReplicaOf: pulumi.String("\"<organization_name>\".\"<account_name>\".\"<connection_name>\""),
Comment: pulumi.String("my complete secondary connection"),
})
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.SecondaryConnection("basic", new()
{
Name = "connection_name",
AsReplicaOf = "\"<organization_name>\".\"<account_name>\".\"<connection_name>\"",
});
//# Complete (with every optional set)
var complete = new Snowflake.SecondaryConnection("complete", new()
{
Name = "connection_name",
AsReplicaOf = "\"<organization_name>\".\"<account_name>\".\"<connection_name>\"",
Comment = "my complete secondary connection",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.snowflake.SecondaryConnection;
import com.pulumi.snowflake.SecondaryConnectionArgs;
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 SecondaryConnection("basic", SecondaryConnectionArgs.builder()
.name("connection_name")
.asReplicaOf("\"<organization_name>\".\"<account_name>\".\"<connection_name>\"")
.build());
//# Complete (with every optional set)
var complete = new SecondaryConnection("complete", SecondaryConnectionArgs.builder()
.name("connection_name")
.asReplicaOf("\"<organization_name>\".\"<account_name>\".\"<connection_name>\"")
.comment("my complete secondary connection")
.build());
}
}
resources:
## Minimal
basic:
type: snowflake:SecondaryConnection
properties:
name: connection_name
asReplicaOf: '"<organization_name>"."<account_name>"."<connection_name>"'
## Complete (with every optional set)
complete:
type: snowflake:SecondaryConnection
properties:
name: connection_name
asReplicaOf: '"<organization_name>"."<account_name>"."<connection_name>"'
comment: my complete secondary connection
Note Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult identifiers guide.
Note When creating a
snowflake.SecondaryConnectionandsnowflake.PrimaryConnectionin onepulumi uprun, thesnowflake.SecondaryConnectionmay return errors, because Snowflake needs some time to register the primary connection before you can create secondary connections based on it. The provider is handling it internally with a retry mechanism, but the time to register may differ and be longer than retry’s maximum wait time. Generally, it is recommended to create thesnowflake.PrimaryConnectionfirst, then create thesnowflake.SecondaryConnectionin a secondpulumi uprun. If you tried to create both in one run, and it failed, just re-run thepulumi up. The time between both runs should be enough for Snowflake to register the primary connection.
Note To promote
snowflake.SecondaryConnectiontosnowflake.PrimaryConnection, 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 promote it manually using:ALTER CONNECTION <name> PRIMARY;and then import it as thesnowflake.PrimaryConnection.
Note If a field has a default value, it is shown next to the type in the schema.
Create SecondaryConnection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SecondaryConnection(name: string, args: SecondaryConnectionArgs, opts?: CustomResourceOptions);@overload
def SecondaryConnection(resource_name: str,
args: SecondaryConnectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SecondaryConnection(resource_name: str,
opts: Optional[ResourceOptions] = None,
as_replica_of: Optional[str] = None,
comment: Optional[str] = None,
name: Optional[str] = None)func NewSecondaryConnection(ctx *Context, name string, args SecondaryConnectionArgs, opts ...ResourceOption) (*SecondaryConnection, error)public SecondaryConnection(string name, SecondaryConnectionArgs args, CustomResourceOptions? opts = null)
public SecondaryConnection(String name, SecondaryConnectionArgs args)
public SecondaryConnection(String name, SecondaryConnectionArgs args, CustomResourceOptions options)
type: snowflake:SecondaryConnection
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 SecondaryConnectionArgs
- 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 SecondaryConnectionArgs
- 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 SecondaryConnectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecondaryConnectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecondaryConnectionArgs
- 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 secondaryConnectionResource = new Snowflake.SecondaryConnection("secondaryConnectionResource", new()
{
AsReplicaOf = "string",
Comment = "string",
Name = "string",
});
example, err := snowflake.NewSecondaryConnection(ctx, "secondaryConnectionResource", &snowflake.SecondaryConnectionArgs{
AsReplicaOf: pulumi.String("string"),
Comment: pulumi.String("string"),
Name: pulumi.String("string"),
})
var secondaryConnectionResource = new SecondaryConnection("secondaryConnectionResource", SecondaryConnectionArgs.builder()
.asReplicaOf("string")
.comment("string")
.name("string")
.build());
secondary_connection_resource = snowflake.SecondaryConnection("secondaryConnectionResource",
as_replica_of="string",
comment="string",
name="string")
const secondaryConnectionResource = new snowflake.SecondaryConnection("secondaryConnectionResource", {
asReplicaOf: "string",
comment: "string",
name: "string",
});
type: snowflake:SecondaryConnection
properties:
asReplicaOf: string
comment: string
name: string
SecondaryConnection 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 SecondaryConnection resource accepts the following input properties:
- As
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- Comment string
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
- As
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- Comment string
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
- as
Replica StringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment String
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
- as
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment string
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
- as_
replica_ strof - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment str
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
- as
Replica StringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment String
- Specifies a comment for the secondary connection.
- 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,".
Outputs
All input properties are implicitly available as output properties. Additionally, the SecondaryConnection resource produces the following output properties:
- Fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Primary bool - Indicates if the connection primary status has been changed. If change is detected, resource will be recreated.
- Show
Outputs List<SecondaryConnection Show Output> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- Fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Primary bool - Indicates if the connection primary status has been changed. If change is detected, resource will be recreated.
- Show
Outputs []SecondaryConnection Show Output - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- fully
Qualified StringName - Fully qualified name of the resource. For more information, see object name resolution.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Primary Boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be recreated.
- show
Outputs List<SecondaryConnection Show Output> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Primary boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be recreated.
- show
Outputs SecondaryConnection Show Output[] - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- fully_
qualified_ strname - 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 primary status has been changed. If change is detected, resource will be recreated.
- show_
outputs Sequence[SecondaryConnection Show Output] - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- fully
Qualified StringName - Fully qualified name of the resource. For more information, see object name resolution.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Primary Boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be recreated.
- show
Outputs List<Property Map> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
Look up Existing SecondaryConnection Resource
Get an existing SecondaryConnection 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?: SecondaryConnectionState, opts?: CustomResourceOptions): SecondaryConnection@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
as_replica_of: Optional[str] = None,
comment: Optional[str] = None,
fully_qualified_name: Optional[str] = None,
is_primary: Optional[bool] = None,
name: Optional[str] = None,
show_outputs: Optional[Sequence[SecondaryConnectionShowOutputArgs]] = None) -> SecondaryConnectionfunc GetSecondaryConnection(ctx *Context, name string, id IDInput, state *SecondaryConnectionState, opts ...ResourceOption) (*SecondaryConnection, error)public static SecondaryConnection Get(string name, Input<string> id, SecondaryConnectionState? state, CustomResourceOptions? opts = null)public static SecondaryConnection get(String name, Output<String> id, SecondaryConnectionState state, CustomResourceOptions options)resources: _: type: snowflake:SecondaryConnection 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.
- As
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- Comment string
- Specifies a comment for the secondary connection.
- Fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- Is
Primary bool - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - Show
Outputs List<SecondaryConnection Show Output> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- As
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- Comment string
- Specifies a comment for the secondary connection.
- Fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- Is
Primary bool - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - Show
Outputs []SecondaryConnection Show Output Args - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- as
Replica StringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment String
- Specifies a comment for the secondary connection.
- fully
Qualified StringName - Fully qualified name of the resource. For more information, see object name resolution.
- is
Primary Boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - show
Outputs List<SecondaryConnection Show Output> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- as
Replica stringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment string
- Specifies a comment for the secondary connection.
- fully
Qualified stringName - Fully qualified name of the resource. For more information, see object name resolution.
- is
Primary boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - show
Outputs SecondaryConnection Show Output[] - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- as_
replica_ strof - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment str
- Specifies a comment for the secondary connection.
- fully_
qualified_ strname - Fully qualified name of the resource. For more information, see object name resolution.
- is_
primary bool - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - show_
outputs Sequence[SecondaryConnection Show Output Args] - Outputs the result of
SHOW CONNECTIONSfor the given connection.
- as
Replica StringOf - Specifies the identifier for a primary connection from which to create a replica (i.e. a secondary connection). For more information about this resource, see docs.
- comment String
- Specifies a comment for the secondary connection.
- fully
Qualified StringName - Fully qualified name of the resource. For more information, see object name resolution.
- is
Primary Boolean - Indicates if the connection primary status has been changed. If change is detected, resource will be 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 secondary connection, the name must match the name of its primary connection. Due to technical limitations (read more here), avoid using the following characters:
|,.,". - show
Outputs List<Property Map> - Outputs the result of
SHOW CONNECTIONSfor the given connection.
Supporting Types
SecondaryConnectionShowOutput, SecondaryConnectionShowOutputArgs
- Account
Locator string - Account
Name string - Comment string
- Connection
Url string - Created
On string - Failover
Allowed List<string>To Accounts - Is
Primary bool - Name string
- Organization
Name string - Primary string
- Region
Group string - Snowflake
Region string
- Account
Locator string - Account
Name string - Comment string
- Connection
Url string - Created
On string - Failover
Allowed []stringTo Accounts - Is
Primary bool - Name string
- Organization
Name string - Primary string
- Region
Group string - Snowflake
Region string
- account
Locator String - account
Name String - comment String
- connection
Url String - created
On String - failover
Allowed List<String>To Accounts - is
Primary Boolean - name String
- organization
Name String - primary String
- region
Group String - snowflake
Region String
- account
Locator string - account
Name string - comment string
- connection
Url string - created
On string - failover
Allowed string[]To Accounts - is
Primary boolean - name string
- organization
Name string - primary string
- region
Group string - snowflake
Region string
- account_
locator str - account_
name str - comment str
- connection_
url str - created_
on str - failover_
allowed_ Sequence[str]to_ accounts - is_
primary bool - name str
- organization_
name str - primary str
- region_
group str - snowflake_
region str
- account
Locator String - account
Name String - comment String
- connection
Url String - created
On String - failover
Allowed List<String>To Accounts - is
Primary Boolean - name String
- organization
Name String - primary String
- region
Group String - snowflake
Region String
Import
$ pulumi import snowflake:index/secondaryConnection:SecondaryConnection example '"<secondary_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
snowflakeTerraform Provider.
