1. Packages
  2. Snowflake
  3. API Docs
  4. Table
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

snowflake.Table

Explore with Pulumi AI

snowflake logo
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const schema = new snowflake.Schema("schema", {
        database: "database",
        name: "schema",
        dataRetentionDays: 1,
    });
    const sequence = new snowflake.Sequence("sequence", {
        database: schema.database,
        schema: schema.name,
        name: "sequence",
    });
    const table = new snowflake.Table("table", {
        database: schema.database,
        schema: schema.name,
        name: "table",
        comment: "A table.",
        clusterBies: ["to_date(DATE)"],
        dataRetentionTimeInDays: schema.dataRetentionTimeInDays,
        changeTracking: false,
        columns: [
            {
                name: "id",
                type: "int",
                nullable: true,
                "default": {
                    sequence: sequence.fullyQualifiedName,
                },
            },
            {
                name: "identity",
                type: "NUMBER(38,0)",
                nullable: true,
                identity: {
                    startNum: 1,
                    stepNum: 3,
                },
            },
            {
                name: "data",
                type: "text",
                nullable: false,
                collate: "en-ci",
            },
            {
                name: "DATE",
                type: "TIMESTAMP_NTZ(9)",
            },
            {
                name: "extra",
                type: "VARIANT",
                comment: "extra data",
            },
        ],
        primaryKey: {
            name: "my_key",
            keys: ["data"],
        },
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    schema = snowflake.Schema("schema",
        database="database",
        name="schema",
        data_retention_days=1)
    sequence = snowflake.Sequence("sequence",
        database=schema.database,
        schema=schema.name,
        name="sequence")
    table = snowflake.Table("table",
        database=schema.database,
        schema=schema.name,
        name="table",
        comment="A table.",
        cluster_bies=["to_date(DATE)"],
        data_retention_time_in_days=schema.data_retention_time_in_days,
        change_tracking=False,
        columns=[
            snowflake.TableColumnArgs(
                name="id",
                type="int",
                nullable=True,
                default=snowflake.TableColumnDefaultArgs(
                    sequence=sequence.fully_qualified_name,
                ),
            ),
            snowflake.TableColumnArgs(
                name="identity",
                type="NUMBER(38,0)",
                nullable=True,
                identity=snowflake.TableColumnIdentityArgs(
                    start_num=1,
                    step_num=3,
                ),
            ),
            snowflake.TableColumnArgs(
                name="data",
                type="text",
                nullable=False,
                collate="en-ci",
            ),
            snowflake.TableColumnArgs(
                name="DATE",
                type="TIMESTAMP_NTZ(9)",
            ),
            snowflake.TableColumnArgs(
                name="extra",
                type="VARIANT",
                comment="extra data",
            ),
        ],
        primary_key=snowflake.TablePrimaryKeyArgs(
            name="my_key",
            keys=["data"],
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		schema, err := snowflake.NewSchema(ctx, "schema", &snowflake.SchemaArgs{
    			Database:          pulumi.String("database"),
    			Name:              pulumi.String("schema"),
    			DataRetentionDays: pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		sequence, err := snowflake.NewSequence(ctx, "sequence", &snowflake.SequenceArgs{
    			Database: schema.Database,
    			Schema:   schema.Name,
    			Name:     pulumi.String("sequence"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.NewTable(ctx, "table", &snowflake.TableArgs{
    			Database: schema.Database,
    			Schema:   schema.Name,
    			Name:     pulumi.String("table"),
    			Comment:  pulumi.String("A table."),
    			ClusterBies: pulumi.StringArray{
    				pulumi.String("to_date(DATE)"),
    			},
    			DataRetentionTimeInDays: schema.DataRetentionTimeInDays,
    			ChangeTracking:          pulumi.Bool(false),
    			Columns: snowflake.TableColumnArray{
    				&snowflake.TableColumnArgs{
    					Name:     pulumi.String("id"),
    					Type:     pulumi.String("int"),
    					Nullable: pulumi.Bool(true),
    					Default: &snowflake.TableColumnDefaultArgs{
    						Sequence: sequence.FullyQualifiedName,
    					},
    				},
    				&snowflake.TableColumnArgs{
    					Name:     pulumi.String("identity"),
    					Type:     pulumi.String("NUMBER(38,0)"),
    					Nullable: pulumi.Bool(true),
    					Identity: &snowflake.TableColumnIdentityArgs{
    						StartNum: pulumi.Int(1),
    						StepNum:  pulumi.Int(3),
    					},
    				},
    				&snowflake.TableColumnArgs{
    					Name:     pulumi.String("data"),
    					Type:     pulumi.String("text"),
    					Nullable: pulumi.Bool(false),
    					Collate:  pulumi.String("en-ci"),
    				},
    				&snowflake.TableColumnArgs{
    					Name: pulumi.String("DATE"),
    					Type: pulumi.String("TIMESTAMP_NTZ(9)"),
    				},
    				&snowflake.TableColumnArgs{
    					Name:    pulumi.String("extra"),
    					Type:    pulumi.String("VARIANT"),
    					Comment: pulumi.String("extra data"),
    				},
    			},
    			PrimaryKey: &snowflake.TablePrimaryKeyArgs{
    				Name: pulumi.String("my_key"),
    				Keys: pulumi.StringArray{
    					pulumi.String("data"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var schema = new Snowflake.Schema("schema", new()
        {
            Database = "database",
            Name = "schema",
            DataRetentionDays = 1,
        });
    
        var sequence = new Snowflake.Sequence("sequence", new()
        {
            Database = schema.Database,
            Schema = schema.Name,
            Name = "sequence",
        });
    
        var table = new Snowflake.Table("table", new()
        {
            Database = schema.Database,
            Schema = schema.Name,
            Name = "table",
            Comment = "A table.",
            ClusterBies = new[]
            {
                "to_date(DATE)",
            },
            DataRetentionTimeInDays = schema.DataRetentionTimeInDays,
            ChangeTracking = false,
            Columns = new[]
            {
                new Snowflake.Inputs.TableColumnArgs
                {
                    Name = "id",
                    Type = "int",
                    Nullable = true,
                    Default = new Snowflake.Inputs.TableColumnDefaultArgs
                    {
                        Sequence = sequence.FullyQualifiedName,
                    },
                },
                new Snowflake.Inputs.TableColumnArgs
                {
                    Name = "identity",
                    Type = "NUMBER(38,0)",
                    Nullable = true,
                    Identity = new Snowflake.Inputs.TableColumnIdentityArgs
                    {
                        StartNum = 1,
                        StepNum = 3,
                    },
                },
                new Snowflake.Inputs.TableColumnArgs
                {
                    Name = "data",
                    Type = "text",
                    Nullable = false,
                    Collate = "en-ci",
                },
                new Snowflake.Inputs.TableColumnArgs
                {
                    Name = "DATE",
                    Type = "TIMESTAMP_NTZ(9)",
                },
                new Snowflake.Inputs.TableColumnArgs
                {
                    Name = "extra",
                    Type = "VARIANT",
                    Comment = "extra data",
                },
            },
            PrimaryKey = new Snowflake.Inputs.TablePrimaryKeyArgs
            {
                Name = "my_key",
                Keys = new[]
                {
                    "data",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.Schema;
    import com.pulumi.snowflake.SchemaArgs;
    import com.pulumi.snowflake.Sequence;
    import com.pulumi.snowflake.SequenceArgs;
    import com.pulumi.snowflake.Table;
    import com.pulumi.snowflake.TableArgs;
    import com.pulumi.snowflake.inputs.TableColumnArgs;
    import com.pulumi.snowflake.inputs.TableColumnDefaultArgs;
    import com.pulumi.snowflake.inputs.TableColumnIdentityArgs;
    import com.pulumi.snowflake.inputs.TablePrimaryKeyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var schema = new Schema("schema", SchemaArgs.builder()
                .database("database")
                .name("schema")
                .dataRetentionDays(1)
                .build());
    
            var sequence = new Sequence("sequence", SequenceArgs.builder()
                .database(schema.database())
                .schema(schema.name())
                .name("sequence")
                .build());
    
            var table = new Table("table", TableArgs.builder()
                .database(schema.database())
                .schema(schema.name())
                .name("table")
                .comment("A table.")
                .clusterBies("to_date(DATE)")
                .dataRetentionTimeInDays(schema.dataRetentionTimeInDays())
                .changeTracking(false)
                .columns(            
                    TableColumnArgs.builder()
                        .name("id")
                        .type("int")
                        .nullable(true)
                        .default_(TableColumnDefaultArgs.builder()
                            .sequence(sequence.fullyQualifiedName())
                            .build())
                        .build(),
                    TableColumnArgs.builder()
                        .name("identity")
                        .type("NUMBER(38,0)")
                        .nullable(true)
                        .identity(TableColumnIdentityArgs.builder()
                            .startNum(1)
                            .stepNum(3)
                            .build())
                        .build(),
                    TableColumnArgs.builder()
                        .name("data")
                        .type("text")
                        .nullable(false)
                        .collate("en-ci")
                        .build(),
                    TableColumnArgs.builder()
                        .name("DATE")
                        .type("TIMESTAMP_NTZ(9)")
                        .build(),
                    TableColumnArgs.builder()
                        .name("extra")
                        .type("VARIANT")
                        .comment("extra data")
                        .build())
                .primaryKey(TablePrimaryKeyArgs.builder()
                    .name("my_key")
                    .keys("data")
                    .build())
                .build());
    
        }
    }
    
    resources:
      schema:
        type: snowflake:Schema
        properties:
          database: database
          name: schema
          dataRetentionDays: 1
      sequence:
        type: snowflake:Sequence
        properties:
          database: ${schema.database}
          schema: ${schema.name}
          name: sequence
      table:
        type: snowflake:Table
        properties:
          database: ${schema.database}
          schema: ${schema.name}
          name: table
          comment: A table.
          clusterBies:
            - to_date(DATE)
          dataRetentionTimeInDays: ${schema.dataRetentionTimeInDays}
          changeTracking: false
          columns:
            - name: id
              type: int
              nullable: true
              default:
                sequence: ${sequence.fullyQualifiedName}
            - name: identity
              type: NUMBER(38,0)
              nullable: true
              identity:
                startNum: 1
                stepNum: 3
            - name: data
              type: text
              nullable: false
              collate: en-ci
            - name: DATE
              type: TIMESTAMP_NTZ(9)
            - name: extra
              type: VARIANT
              comment: extra data
          primaryKey:
            name: my_key
            keys:
              - data
    

    Create Table Resource

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

    Constructor syntax

    new Table(name: string, args: TableArgs, opts?: CustomResourceOptions);
    @overload
    def Table(resource_name: str,
              args: TableArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Table(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              columns: Optional[Sequence[TableColumnArgs]] = None,
              database: Optional[str] = None,
              schema: Optional[str] = None,
              change_tracking: Optional[bool] = None,
              cluster_bies: Optional[Sequence[str]] = None,
              comment: Optional[str] = None,
              data_retention_time_in_days: Optional[int] = None,
              name: Optional[str] = None,
              primary_key: Optional[TablePrimaryKeyArgs] = None,
              tags: Optional[Sequence[TableTagArgs]] = None)
    func NewTable(ctx *Context, name string, args TableArgs, opts ...ResourceOption) (*Table, error)
    public Table(string name, TableArgs args, CustomResourceOptions? opts = null)
    public Table(String name, TableArgs args)
    public Table(String name, TableArgs args, CustomResourceOptions options)
    
    type: snowflake:Table
    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 TableArgs
    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 TableArgs
    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 TableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TableArgs
    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 tableResource = new Snowflake.Table("tableResource", new()
    {
        Columns = new[]
        {
            new Snowflake.Inputs.TableColumnArgs
            {
                Name = "string",
                Type = "string",
                Collate = "string",
                Comment = "string",
                Default = new Snowflake.Inputs.TableColumnDefaultArgs
                {
                    Constant = "string",
                    Expression = "string",
                    Sequence = "string",
                },
                Identity = new Snowflake.Inputs.TableColumnIdentityArgs
                {
                    StartNum = 0,
                    StepNum = 0,
                },
                MaskingPolicy = "string",
                Nullable = false,
                SchemaEvolutionRecord = "string",
            },
        },
        Database = "string",
        Schema = "string",
        ChangeTracking = false,
        ClusterBies = new[]
        {
            "string",
        },
        Comment = "string",
        DataRetentionTimeInDays = 0,
        Name = "string",
    });
    
    example, err := snowflake.NewTable(ctx, "tableResource", &snowflake.TableArgs{
    	Columns: snowflake.TableColumnArray{
    		&snowflake.TableColumnArgs{
    			Name:    pulumi.String("string"),
    			Type:    pulumi.String("string"),
    			Collate: pulumi.String("string"),
    			Comment: pulumi.String("string"),
    			Default: &snowflake.TableColumnDefaultArgs{
    				Constant:   pulumi.String("string"),
    				Expression: pulumi.String("string"),
    				Sequence:   pulumi.String("string"),
    			},
    			Identity: &snowflake.TableColumnIdentityArgs{
    				StartNum: pulumi.Int(0),
    				StepNum:  pulumi.Int(0),
    			},
    			MaskingPolicy:         pulumi.String("string"),
    			Nullable:              pulumi.Bool(false),
    			SchemaEvolutionRecord: pulumi.String("string"),
    		},
    	},
    	Database:       pulumi.String("string"),
    	Schema:         pulumi.String("string"),
    	ChangeTracking: pulumi.Bool(false),
    	ClusterBies: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Comment:                 pulumi.String("string"),
    	DataRetentionTimeInDays: pulumi.Int(0),
    	Name:                    pulumi.String("string"),
    })
    
    var tableResource = new Table("tableResource", TableArgs.builder()
        .columns(TableColumnArgs.builder()
            .name("string")
            .type("string")
            .collate("string")
            .comment("string")
            .default_(TableColumnDefaultArgs.builder()
                .constant("string")
                .expression("string")
                .sequence("string")
                .build())
            .identity(TableColumnIdentityArgs.builder()
                .startNum(0)
                .stepNum(0)
                .build())
            .maskingPolicy("string")
            .nullable(false)
            .schemaEvolutionRecord("string")
            .build())
        .database("string")
        .schema("string")
        .changeTracking(false)
        .clusterBies("string")
        .comment("string")
        .dataRetentionTimeInDays(0)
        .name("string")
        .build());
    
    table_resource = snowflake.Table("tableResource",
        columns=[snowflake.TableColumnArgs(
            name="string",
            type="string",
            collate="string",
            comment="string",
            default=snowflake.TableColumnDefaultArgs(
                constant="string",
                expression="string",
                sequence="string",
            ),
            identity=snowflake.TableColumnIdentityArgs(
                start_num=0,
                step_num=0,
            ),
            masking_policy="string",
            nullable=False,
            schema_evolution_record="string",
        )],
        database="string",
        schema="string",
        change_tracking=False,
        cluster_bies=["string"],
        comment="string",
        data_retention_time_in_days=0,
        name="string")
    
    const tableResource = new snowflake.Table("tableResource", {
        columns: [{
            name: "string",
            type: "string",
            collate: "string",
            comment: "string",
            "default": {
                constant: "string",
                expression: "string",
                sequence: "string",
            },
            identity: {
                startNum: 0,
                stepNum: 0,
            },
            maskingPolicy: "string",
            nullable: false,
            schemaEvolutionRecord: "string",
        }],
        database: "string",
        schema: "string",
        changeTracking: false,
        clusterBies: ["string"],
        comment: "string",
        dataRetentionTimeInDays: 0,
        name: "string",
    });
    
    type: snowflake:Table
    properties:
        changeTracking: false
        clusterBies:
            - string
        columns:
            - collate: string
              comment: string
              default:
                constant: string
                expression: string
                sequence: string
              identity:
                startNum: 0
                stepNum: 0
              maskingPolicy: string
              name: string
              nullable: false
              schemaEvolutionRecord: string
              type: string
        comment: string
        dataRetentionTimeInDays: 0
        database: string
        name: string
        schema: string
    

    Table Resource Properties

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

    Inputs

    The Table resource accepts the following input properties:

    Columns List<TableColumn>
    Definitions of a column to create in the table. Minimum one required.
    Database string
    The database in which to create the table.
    Schema string
    The schema in which to create the table.
    ChangeTracking bool
    Specifies whether to enable change tracking on the table. Default false.
    ClusterBies List<string>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    Comment string
    Specifies a comment for the table.
    DataRetentionTimeInDays int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    Name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    PrimaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    Tags List<TableTag>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    Columns []TableColumnArgs
    Definitions of a column to create in the table. Minimum one required.
    Database string
    The database in which to create the table.
    Schema string
    The schema in which to create the table.
    ChangeTracking bool
    Specifies whether to enable change tracking on the table. Default false.
    ClusterBies []string
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    Comment string
    Specifies a comment for the table.
    DataRetentionTimeInDays int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    Name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    PrimaryKey TablePrimaryKeyArgs
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    Tags []TableTagArgs
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    columns List<TableColumn>
    Definitions of a column to create in the table. Minimum one required.
    database String
    The database in which to create the table.
    schema String
    The schema in which to create the table.
    changeTracking Boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies List<String>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    comment String
    Specifies a comment for the table.
    dataRetentionTimeInDays Integer
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    name String
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    primaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    tags List<TableTag>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    columns TableColumn[]
    Definitions of a column to create in the table. Minimum one required.
    database string
    The database in which to create the table.
    schema string
    The schema in which to create the table.
    changeTracking boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies string[]
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    comment string
    Specifies a comment for the table.
    dataRetentionTimeInDays number
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    primaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    tags TableTag[]
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    columns Sequence[TableColumnArgs]
    Definitions of a column to create in the table. Minimum one required.
    database str
    The database in which to create the table.
    schema str
    The schema in which to create the table.
    change_tracking bool
    Specifies whether to enable change tracking on the table. Default false.
    cluster_bies Sequence[str]
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    comment str
    Specifies a comment for the table.
    data_retention_time_in_days int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    name str
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    primary_key TablePrimaryKeyArgs
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    tags Sequence[TableTagArgs]
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    columns List<Property Map>
    Definitions of a column to create in the table. Minimum one required.
    database String
    The database in which to create the table.
    schema String
    The schema in which to create the table.
    changeTracking Boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies List<String>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    comment String
    Specifies a comment for the table.
    dataRetentionTimeInDays Number
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    name String
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    primaryKey Property Map
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    tags List<Property Map>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    Name of the role that owns the table.
    QualifiedName string
    Qualified name of the table.
    Id string
    The provider-assigned unique ID for this managed resource.
    Owner string
    Name of the role that owns the table.
    QualifiedName string
    Qualified name of the table.
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    Name of the role that owns the table.
    qualifiedName String
    Qualified name of the table.
    id string
    The provider-assigned unique ID for this managed resource.
    owner string
    Name of the role that owns the table.
    qualifiedName string
    Qualified name of the table.
    id str
    The provider-assigned unique ID for this managed resource.
    owner str
    Name of the role that owns the table.
    qualified_name str
    Qualified name of the table.
    id String
    The provider-assigned unique ID for this managed resource.
    owner String
    Name of the role that owns the table.
    qualifiedName String
    Qualified name of the table.

    Look up Existing Table Resource

    Get an existing Table 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?: TableState, opts?: CustomResourceOptions): Table
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            change_tracking: Optional[bool] = None,
            cluster_bies: Optional[Sequence[str]] = None,
            columns: Optional[Sequence[TableColumnArgs]] = None,
            comment: Optional[str] = None,
            data_retention_time_in_days: Optional[int] = None,
            database: Optional[str] = None,
            name: Optional[str] = None,
            owner: Optional[str] = None,
            primary_key: Optional[TablePrimaryKeyArgs] = None,
            qualified_name: Optional[str] = None,
            schema: Optional[str] = None,
            tags: Optional[Sequence[TableTagArgs]] = None) -> Table
    func GetTable(ctx *Context, name string, id IDInput, state *TableState, opts ...ResourceOption) (*Table, error)
    public static Table Get(string name, Input<string> id, TableState? state, CustomResourceOptions? opts = null)
    public static Table get(String name, Output<String> id, TableState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    ChangeTracking bool
    Specifies whether to enable change tracking on the table. Default false.
    ClusterBies List<string>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    Columns List<TableColumn>
    Definitions of a column to create in the table. Minimum one required.
    Comment string
    Specifies a comment for the table.
    DataRetentionTimeInDays int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    Database string
    The database in which to create the table.
    Name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    Owner string
    Name of the role that owns the table.
    PrimaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    QualifiedName string
    Qualified name of the table.
    Schema string
    The schema in which to create the table.
    Tags List<TableTag>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    ChangeTracking bool
    Specifies whether to enable change tracking on the table. Default false.
    ClusterBies []string
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    Columns []TableColumnArgs
    Definitions of a column to create in the table. Minimum one required.
    Comment string
    Specifies a comment for the table.
    DataRetentionTimeInDays int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    Database string
    The database in which to create the table.
    Name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    Owner string
    Name of the role that owns the table.
    PrimaryKey TablePrimaryKeyArgs
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    QualifiedName string
    Qualified name of the table.
    Schema string
    The schema in which to create the table.
    Tags []TableTagArgs
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    changeTracking Boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies List<String>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    columns List<TableColumn>
    Definitions of a column to create in the table. Minimum one required.
    comment String
    Specifies a comment for the table.
    dataRetentionTimeInDays Integer
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    database String
    The database in which to create the table.
    name String
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    owner String
    Name of the role that owns the table.
    primaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    qualifiedName String
    Qualified name of the table.
    schema String
    The schema in which to create the table.
    tags List<TableTag>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    changeTracking boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies string[]
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    columns TableColumn[]
    Definitions of a column to create in the table. Minimum one required.
    comment string
    Specifies a comment for the table.
    dataRetentionTimeInDays number
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    database string
    The database in which to create the table.
    name string
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    owner string
    Name of the role that owns the table.
    primaryKey TablePrimaryKey
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    qualifiedName string
    Qualified name of the table.
    schema string
    The schema in which to create the table.
    tags TableTag[]
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    change_tracking bool
    Specifies whether to enable change tracking on the table. Default false.
    cluster_bies Sequence[str]
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    columns Sequence[TableColumnArgs]
    Definitions of a column to create in the table. Minimum one required.
    comment str
    Specifies a comment for the table.
    data_retention_time_in_days int
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    database str
    The database in which to create the table.
    name str
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    owner str
    Name of the role that owns the table.
    primary_key TablePrimaryKeyArgs
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    qualified_name str
    Qualified name of the table.
    schema str
    The schema in which to create the table.
    tags Sequence[TableTagArgs]
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    changeTracking Boolean
    Specifies whether to enable change tracking on the table. Default false.
    clusterBies List<String>
    A list of one or more table columns/expressions to be used as clustering key(s) for the table
    columns List<Property Map>
    Definitions of a column to create in the table. Minimum one required.
    comment String
    Specifies a comment for the table.
    dataRetentionTimeInDays Number
    Specifies the retention period for the table so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed on historical data in the table. If you wish to inherit the parent schema setting then pass in the schema attribute to this argument or do not fill this parameter at all; the default value for this field is -1, which is a fallback to use Snowflake default - in this case the schema value
    database String
    The database in which to create the table.
    name String
    Specifies the identifier for the table; must be unique for the database and schema in which the table is created.
    owner String
    Name of the role that owns the table.
    primaryKey Property Map
    Definitions of primary key constraint to create on table

    Deprecated: Use snowflake.TableConstraint instead

    qualifiedName String
    Qualified name of the table.
    schema String
    The schema in which to create the table.
    tags List<Property Map>
    Definitions of a tag to associate with the resource.

    Deprecated: Use the 'snowflake_tag_association' resource instead.

    Supporting Types

    TableColumn, TableColumnArgs

    Name string
    Column name
    Type string
    Column type, e.g. VARIANT
    Collate string
    Column collation, e.g. utf8
    Comment string
    Column comment
    Default TableColumnDefault
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    Identity TableColumnIdentity
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    MaskingPolicy string
    Masking policy to apply on column. It has to be a fully qualified name.
    Nullable bool
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    SchemaEvolutionRecord string
    Record of schema evolution.
    Name string
    Column name
    Type string
    Column type, e.g. VARIANT
    Collate string
    Column collation, e.g. utf8
    Comment string
    Column comment
    Default TableColumnDefault
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    Identity TableColumnIdentity
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    MaskingPolicy string
    Masking policy to apply on column. It has to be a fully qualified name.
    Nullable bool
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    SchemaEvolutionRecord string
    Record of schema evolution.
    name String
    Column name
    type String
    Column type, e.g. VARIANT
    collate String
    Column collation, e.g. utf8
    comment String
    Column comment
    default_ TableColumnDefault
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    identity TableColumnIdentity
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    maskingPolicy String
    Masking policy to apply on column. It has to be a fully qualified name.
    nullable Boolean
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    schemaEvolutionRecord String
    Record of schema evolution.
    name string
    Column name
    type string
    Column type, e.g. VARIANT
    collate string
    Column collation, e.g. utf8
    comment string
    Column comment
    default TableColumnDefault
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    identity TableColumnIdentity
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    maskingPolicy string
    Masking policy to apply on column. It has to be a fully qualified name.
    nullable boolean
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    schemaEvolutionRecord string
    Record of schema evolution.
    name str
    Column name
    type str
    Column type, e.g. VARIANT
    collate str
    Column collation, e.g. utf8
    comment str
    Column comment
    default TableColumnDefault
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    identity TableColumnIdentity
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    masking_policy str
    Masking policy to apply on column. It has to be a fully qualified name.
    nullable bool
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    schema_evolution_record str
    Record of schema evolution.
    name String
    Column name
    type String
    Column type, e.g. VARIANT
    collate String
    Column collation, e.g. utf8
    comment String
    Column comment
    default Property Map
    Defines the column default value; note due to limitations of Snowflake's ALTER TABLE ADD/MODIFY COLUMN updates to default will not be applied
    identity Property Map
    Defines the identity start/step values for a column. Note Identity/default are mutually exclusive.
    maskingPolicy String
    Masking policy to apply on column. It has to be a fully qualified name.
    nullable Boolean
    Whether this column can contain null values. Note: Depending on your Snowflake version, the default value will not suffice if this column is used in a primary key constraint.
    schemaEvolutionRecord String
    Record of schema evolution.

    TableColumnDefault, TableColumnDefaultArgs

    Constant string
    The default constant value for the column
    Expression string
    The default expression value for the column
    Sequence string
    The default sequence to use for the column
    Constant string
    The default constant value for the column
    Expression string
    The default expression value for the column
    Sequence string
    The default sequence to use for the column
    constant String
    The default constant value for the column
    expression String
    The default expression value for the column
    sequence String
    The default sequence to use for the column
    constant string
    The default constant value for the column
    expression string
    The default expression value for the column
    sequence string
    The default sequence to use for the column
    constant str
    The default constant value for the column
    expression str
    The default expression value for the column
    sequence str
    The default sequence to use for the column
    constant String
    The default constant value for the column
    expression String
    The default expression value for the column
    sequence String
    The default sequence to use for the column

    TableColumnIdentity, TableColumnIdentityArgs

    StartNum int
    The number to start incrementing at.
    StepNum int
    Step size to increment by.
    StartNum int
    The number to start incrementing at.
    StepNum int
    Step size to increment by.
    startNum Integer
    The number to start incrementing at.
    stepNum Integer
    Step size to increment by.
    startNum number
    The number to start incrementing at.
    stepNum number
    Step size to increment by.
    start_num int
    The number to start incrementing at.
    step_num int
    Step size to increment by.
    startNum Number
    The number to start incrementing at.
    stepNum Number
    Step size to increment by.

    TablePrimaryKey, TablePrimaryKeyArgs

    Keys List<string>
    Columns to use in primary key
    Name string
    Name of constraint
    Keys []string
    Columns to use in primary key
    Name string
    Name of constraint
    keys List<String>
    Columns to use in primary key
    name String
    Name of constraint
    keys string[]
    Columns to use in primary key
    name string
    Name of constraint
    keys Sequence[str]
    Columns to use in primary key
    name str
    Name of constraint
    keys List<String>
    Columns to use in primary key
    name String
    Name of constraint

    TableTag, TableTagArgs

    Name string
    Tag name, e.g. department.
    Value string
    Tag value, e.g. marketing_info.
    Database string
    Name of the database that the tag was created in.
    Schema string
    Name of the schema that the tag was created in.
    Name string
    Tag name, e.g. department.
    Value string
    Tag value, e.g. marketing_info.
    Database string
    Name of the database that the tag was created in.
    Schema string
    Name of the schema that the tag was created in.
    name String
    Tag name, e.g. department.
    value String
    Tag value, e.g. marketing_info.
    database String
    Name of the database that the tag was created in.
    schema String
    Name of the schema that the tag was created in.
    name string
    Tag name, e.g. department.
    value string
    Tag value, e.g. marketing_info.
    database string
    Name of the database that the tag was created in.
    schema string
    Name of the schema that the tag was created in.
    name str
    Tag name, e.g. department.
    value str
    Tag value, e.g. marketing_info.
    database str
    Name of the database that the tag was created in.
    schema str
    Name of the schema that the tag was created in.
    name String
    Tag name, e.g. department.
    value String
    Tag value, e.g. marketing_info.
    database String
    Name of the database that the tag was created in.
    schema String
    Name of the schema that the tag was created in.

    Import

    format is database name | schema name | table name

    $ pulumi import snowflake:index/table:Table example 'databaseName|schemaName|tableName'
    

    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 v0.55.0 published on Friday, Jun 7, 2024 by Pulumi