1. Packages
  2. Snowflake Provider
  3. API Docs
  4. TableConstraint
Snowflake v1.3.0 published on Wednesday, Apr 23, 2025 by Pulumi

snowflake.TableConstraint

Explore with Pulumi AI

Import

$ pulumi import snowflake:index/tableConstraint:TableConstraint example 'myconstraintfk❄️FOREIGN KEY❄️databaseName|schemaName|tableName'
Copy

Create TableConstraint Resource

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

Constructor syntax

new TableConstraint(name: string, args: TableConstraintArgs, opts?: CustomResourceOptions);
@overload
def TableConstraint(resource_name: str,
                    args: TableConstraintArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def TableConstraint(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    columns: Optional[Sequence[str]] = None,
                    table_id: Optional[str] = None,
                    type: Optional[str] = None,
                    comment: Optional[str] = None,
                    deferrable: Optional[bool] = None,
                    enable: Optional[bool] = None,
                    enforced: Optional[bool] = None,
                    foreign_key_properties: Optional[TableConstraintForeignKeyPropertiesArgs] = None,
                    initially: Optional[str] = None,
                    name: Optional[str] = None,
                    rely: Optional[bool] = None,
                    validate: Optional[bool] = None)
func NewTableConstraint(ctx *Context, name string, args TableConstraintArgs, opts ...ResourceOption) (*TableConstraint, error)
public TableConstraint(string name, TableConstraintArgs args, CustomResourceOptions? opts = null)
public TableConstraint(String name, TableConstraintArgs args)
public TableConstraint(String name, TableConstraintArgs args, CustomResourceOptions options)
type: snowflake:TableConstraint
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TableConstraintArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TableConstraintArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TableConstraintArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TableConstraintArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TableConstraintArgs
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 tableConstraintResource = new Snowflake.TableConstraint("tableConstraintResource", new()
{
    Columns = new[]
    {
        "string",
    },
    TableId = "string",
    Type = "string",
    Deferrable = false,
    Enable = false,
    Enforced = false,
    ForeignKeyProperties = new Snowflake.Inputs.TableConstraintForeignKeyPropertiesArgs
    {
        References = new Snowflake.Inputs.TableConstraintForeignKeyPropertiesReferencesArgs
        {
            Columns = new[]
            {
                "string",
            },
            TableId = "string",
        },
        Match = "string",
        OnDelete = "string",
        OnUpdate = "string",
    },
    Initially = "string",
    Name = "string",
    Rely = false,
    Validate = false,
});
Copy
example, err := snowflake.NewTableConstraint(ctx, "tableConstraintResource", &snowflake.TableConstraintArgs{
	Columns: pulumi.StringArray{
		pulumi.String("string"),
	},
	TableId:    pulumi.String("string"),
	Type:       pulumi.String("string"),
	Deferrable: pulumi.Bool(false),
	Enable:     pulumi.Bool(false),
	Enforced:   pulumi.Bool(false),
	ForeignKeyProperties: &snowflake.TableConstraintForeignKeyPropertiesArgs{
		References: &snowflake.TableConstraintForeignKeyPropertiesReferencesArgs{
			Columns: pulumi.StringArray{
				pulumi.String("string"),
			},
			TableId: pulumi.String("string"),
		},
		Match:    pulumi.String("string"),
		OnDelete: pulumi.String("string"),
		OnUpdate: pulumi.String("string"),
	},
	Initially: pulumi.String("string"),
	Name:      pulumi.String("string"),
	Rely:      pulumi.Bool(false),
	Validate:  pulumi.Bool(false),
})
Copy
var tableConstraintResource = new TableConstraint("tableConstraintResource", TableConstraintArgs.builder()
    .columns("string")
    .tableId("string")
    .type("string")
    .deferrable(false)
    .enable(false)
    .enforced(false)
    .foreignKeyProperties(TableConstraintForeignKeyPropertiesArgs.builder()
        .references(TableConstraintForeignKeyPropertiesReferencesArgs.builder()
            .columns("string")
            .tableId("string")
            .build())
        .match("string")
        .onDelete("string")
        .onUpdate("string")
        .build())
    .initially("string")
    .name("string")
    .rely(false)
    .validate(false)
    .build());
Copy
table_constraint_resource = snowflake.TableConstraint("tableConstraintResource",
    columns=["string"],
    table_id="string",
    type="string",
    deferrable=False,
    enable=False,
    enforced=False,
    foreign_key_properties={
        "references": {
            "columns": ["string"],
            "table_id": "string",
        },
        "match": "string",
        "on_delete": "string",
        "on_update": "string",
    },
    initially="string",
    name="string",
    rely=False,
    validate=False)
Copy
const tableConstraintResource = new snowflake.TableConstraint("tableConstraintResource", {
    columns: ["string"],
    tableId: "string",
    type: "string",
    deferrable: false,
    enable: false,
    enforced: false,
    foreignKeyProperties: {
        references: {
            columns: ["string"],
            tableId: "string",
        },
        match: "string",
        onDelete: "string",
        onUpdate: "string",
    },
    initially: "string",
    name: "string",
    rely: false,
    validate: false,
});
Copy
type: snowflake:TableConstraint
properties:
    columns:
        - string
    deferrable: false
    enable: false
    enforced: false
    foreignKeyProperties:
        match: string
        onDelete: string
        onUpdate: string
        references:
            columns:
                - string
            tableId: string
    initially: string
    name: string
    rely: false
    tableId: string
    type: string
    validate: false
Copy

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

Columns
This property is required.
Changes to this property will trigger replacement.
List<string>
Columns to use in constraint key
TableId
This property is required.
Changes to this property will trigger replacement.
string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
Comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

Deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
Enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
Enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
ForeignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
Initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
Name string
Name of constraint
Rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
Validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
Columns
This property is required.
Changes to this property will trigger replacement.
[]string
Columns to use in constraint key
TableId
This property is required.
Changes to this property will trigger replacement.
string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
Comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

Deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
Enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
Enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
ForeignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyPropertiesArgs
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
Initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
Name string
Name of constraint
Rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
Validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns
This property is required.
Changes to this property will trigger replacement.
List<String>
Columns to use in constraint key
tableId
This property is required.
Changes to this property will trigger replacement.
String
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type
This property is required.
Changes to this property will trigger replacement.
String
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
comment String
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. Boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. Boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. String
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name String
Name of constraint
rely Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
validate Changes to this property will trigger replacement. Boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns
This property is required.
Changes to this property will trigger replacement.
string[]
Columns to use in constraint key
tableId
This property is required.
Changes to this property will trigger replacement.
string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type
This property is required.
Changes to this property will trigger replacement.
string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name string
Name of constraint
rely Changes to this property will trigger replacement. boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
validate Changes to this property will trigger replacement. boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns
This property is required.
Changes to this property will trigger replacement.
Sequence[str]
Columns to use in constraint key
table_id
This property is required.
Changes to this property will trigger replacement.
str
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type
This property is required.
Changes to this property will trigger replacement.
str
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
comment str
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
foreign_key_properties Changes to this property will trigger replacement. TableConstraintForeignKeyPropertiesArgs
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. str
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name str
Name of constraint
rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns
This property is required.
Changes to this property will trigger replacement.
List<String>
Columns to use in constraint key
tableId
This property is required.
Changes to this property will trigger replacement.
String
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type
This property is required.
Changes to this property will trigger replacement.
String
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
comment String
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. Boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. Boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. Property Map
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. String
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name String
Name of constraint
rely Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
validate Changes to this property will trigger replacement. Boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TableConstraint Resource

Get an existing TableConstraint 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?: TableConstraintState, opts?: CustomResourceOptions): TableConstraint
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        columns: Optional[Sequence[str]] = None,
        comment: Optional[str] = None,
        deferrable: Optional[bool] = None,
        enable: Optional[bool] = None,
        enforced: Optional[bool] = None,
        foreign_key_properties: Optional[TableConstraintForeignKeyPropertiesArgs] = None,
        initially: Optional[str] = None,
        name: Optional[str] = None,
        rely: Optional[bool] = None,
        table_id: Optional[str] = None,
        type: Optional[str] = None,
        validate: Optional[bool] = None) -> TableConstraint
func GetTableConstraint(ctx *Context, name string, id IDInput, state *TableConstraintState, opts ...ResourceOption) (*TableConstraint, error)
public static TableConstraint Get(string name, Input<string> id, TableConstraintState? state, CustomResourceOptions? opts = null)
public static TableConstraint get(String name, Output<String> id, TableConstraintState state, CustomResourceOptions options)
resources:  _:    type: snowflake:TableConstraint    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Columns Changes to this property will trigger replacement. List<string>
Columns to use in constraint key
Comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

Deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
Enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
Enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
ForeignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
Initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
Name string
Name of constraint
Rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
TableId Changes to this property will trigger replacement. string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
Type Changes to this property will trigger replacement. string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
Validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
Columns Changes to this property will trigger replacement. []string
Columns to use in constraint key
Comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

Deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
Enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
Enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
ForeignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyPropertiesArgs
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
Initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
Name string
Name of constraint
Rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
TableId Changes to this property will trigger replacement. string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
Type Changes to this property will trigger replacement. string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
Validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns Changes to this property will trigger replacement. List<String>
Columns to use in constraint key
comment String
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. Boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. Boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. String
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name String
Name of constraint
rely Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
tableId Changes to this property will trigger replacement. String
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type Changes to this property will trigger replacement. String
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
validate Changes to this property will trigger replacement. Boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns Changes to this property will trigger replacement. string[]
Columns to use in constraint key
comment string
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. TableConstraintForeignKeyProperties
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. string
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name string
Name of constraint
rely Changes to this property will trigger replacement. boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
tableId Changes to this property will trigger replacement. string
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type Changes to this property will trigger replacement. string
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
validate Changes to this property will trigger replacement. boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns Changes to this property will trigger replacement. Sequence[str]
Columns to use in constraint key
comment str
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. bool
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. bool
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. bool
(Default: false) Whether the constraint is enforced
foreign_key_properties Changes to this property will trigger replacement. TableConstraintForeignKeyPropertiesArgs
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. str
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name str
Name of constraint
rely Changes to this property will trigger replacement. bool
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
table_id Changes to this property will trigger replacement. str
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type Changes to this property will trigger replacement. str
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
validate Changes to this property will trigger replacement. bool
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.
columns Changes to this property will trigger replacement. List<String>
Columns to use in constraint key
comment String
Comment for the table constraint

Deprecated: Not used. Will be removed.

deferrable Changes to this property will trigger replacement. Boolean
(Default: true) Whether the constraint is deferrable
enable Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether the constraint is enabled or disabled. These properties are provided for compatibility with Oracle.
enforced Changes to this property will trigger replacement. Boolean
(Default: false) Whether the constraint is enforced
foreignKeyProperties Changes to this property will trigger replacement. Property Map
Additional properties when type is set to foreign key. Not applicable for primary/unique keys
initially Changes to this property will trigger replacement. String
(Default: DEFERRED) Whether the constraint is initially deferred or immediate
name String
Name of constraint
rely Changes to this property will trigger replacement. Boolean
(Default: true) Specifies whether a constraint in NOVALIDATE mode is taken into account during query rewrite.
tableId Changes to this property will trigger replacement. String
Identifier for table to create constraint on. Format must follow: ""<dbname>"."<schemaname>"."<tablename>"" or "<dbname>.<schemaname>.<tablename>" (snowflaketable.mytable.id)
type Changes to this property will trigger replacement. String
Type of constraint, one of 'UNIQUE', 'PRIMARY KEY', or 'FOREIGN KEY'
validate Changes to this property will trigger replacement. Boolean
(Default: false) Specifies whether to validate existing data on the table when a constraint is created. Only used in conjunction with the ENABLE property.

Supporting Types

TableConstraintForeignKeyProperties
, TableConstraintForeignKeyPropertiesArgs

References
This property is required.
Changes to this property will trigger replacement.
TableConstraintForeignKeyPropertiesReferences
The table and columns that the foreign key references.
Match Changes to this property will trigger replacement. string
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
OnDelete Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
OnUpdate Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys
References
This property is required.
Changes to this property will trigger replacement.
TableConstraintForeignKeyPropertiesReferences
The table and columns that the foreign key references.
Match Changes to this property will trigger replacement. string
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
OnDelete Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
OnUpdate Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys
references
This property is required.
Changes to this property will trigger replacement.
TableConstraintForeignKeyPropertiesReferences
The table and columns that the foreign key references.
match Changes to this property will trigger replacement. String
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
onDelete Changes to this property will trigger replacement. String
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
onUpdate Changes to this property will trigger replacement. String
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys
references
This property is required.
Changes to this property will trigger replacement.
TableConstraintForeignKeyPropertiesReferences
The table and columns that the foreign key references.
match Changes to this property will trigger replacement. string
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
onDelete Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
onUpdate Changes to this property will trigger replacement. string
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys
references
This property is required.
Changes to this property will trigger replacement.
TableConstraintForeignKeyPropertiesReferences
The table and columns that the foreign key references.
match Changes to this property will trigger replacement. str
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
on_delete Changes to this property will trigger replacement. str
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
on_update Changes to this property will trigger replacement. str
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys
references
This property is required.
Changes to this property will trigger replacement.
Property Map
The table and columns that the foreign key references.
match Changes to this property will trigger replacement. String
(Default: FULL) The match type for the foreign key. Not applicable for primary/unique keys
onDelete Changes to this property will trigger replacement. String
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is deleted. Not applicable for primary/unique keys
onUpdate Changes to this property will trigger replacement. String
(Default: NO ACTION) Specifies the action performed when the primary/unique key for the foreign key is updated. Not applicable for primary/unique keys

TableConstraintForeignKeyPropertiesReferences
, TableConstraintForeignKeyPropertiesReferencesArgs

Columns This property is required. List<string>
Columns to use in foreign key reference
TableId This property is required. string
Name of constraint
Columns This property is required. []string
Columns to use in foreign key reference
TableId This property is required. string
Name of constraint
columns This property is required. List<String>
Columns to use in foreign key reference
tableId This property is required. String
Name of constraint
columns This property is required. string[]
Columns to use in foreign key reference
tableId This property is required. string
Name of constraint
columns This property is required. Sequence[str]
Columns to use in foreign key reference
table_id This property is required. str
Name of constraint
columns This property is required. List<String>
Columns to use in foreign key reference
tableId This property is required. String
Name of constraint

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.