1. Packages
  2. Snowflake Provider
  3. API Docs
  4. Sequence
Viewing docs for Snowflake v2.13.0
published on Thursday, Feb 26, 2026 by Pulumi
snowflake logo
Viewing docs for Snowflake v2.13.0
published on Thursday, Feb 26, 2026 by Pulumi

    !> Caution: Preview Feature This feature is considered a preview feature in the provider, regardless of the state of the resource in Snowflake. We do not guarantee its stability. It will be reworked and marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add the relevant feature name to preview_features_enabled field in the provider configuration. Please always refer to the Getting Help section in our Github repo to best determine how to get help for your questions.

    Example Usage

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

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const test = new snowflake.Database("test", {name: "things"});
    const testSchema = new snowflake.Schema("test_schema", {
        name: "things",
        database: test.name,
    });
    const testSequence = new snowflake.Sequence("test_sequence", {
        database: test.name,
        schema: testSchema.name,
        name: "thing_counter",
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    test = snowflake.Database("test", name="things")
    test_schema = snowflake.Schema("test_schema",
        name="things",
        database=test.name)
    test_sequence = snowflake.Sequence("test_sequence",
        database=test.name,
        schema=test_schema.name,
        name="thing_counter")
    
    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 {
    		test, err := snowflake.NewDatabase(ctx, "test", &snowflake.DatabaseArgs{
    			Name: pulumi.String("things"),
    		})
    		if err != nil {
    			return err
    		}
    		testSchema, err := snowflake.NewSchema(ctx, "test_schema", &snowflake.SchemaArgs{
    			Name:     pulumi.String("things"),
    			Database: test.Name,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.NewSequence(ctx, "test_sequence", &snowflake.SequenceArgs{
    			Database: test.Name,
    			Schema:   testSchema.Name,
    			Name:     pulumi.String("thing_counter"),
    		})
    		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 test = new Snowflake.Database("test", new()
        {
            Name = "things",
        });
    
        var testSchema = new Snowflake.Schema("test_schema", new()
        {
            Name = "things",
            Database = test.Name,
        });
    
        var testSequence = new Snowflake.Sequence("test_sequence", new()
        {
            Database = test.Name,
            Schema = testSchema.Name,
            Name = "thing_counter",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.Database;
    import com.pulumi.snowflake.DatabaseArgs;
    import com.pulumi.snowflake.Schema;
    import com.pulumi.snowflake.SchemaArgs;
    import com.pulumi.snowflake.Sequence;
    import com.pulumi.snowflake.SequenceArgs;
    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 test = new Database("test", DatabaseArgs.builder()
                .name("things")
                .build());
    
            var testSchema = new Schema("testSchema", SchemaArgs.builder()
                .name("things")
                .database(test.name())
                .build());
    
            var testSequence = new Sequence("testSequence", SequenceArgs.builder()
                .database(test.name())
                .schema(testSchema.name())
                .name("thing_counter")
                .build());
    
        }
    }
    
    resources:
      test:
        type: snowflake:Database
        properties:
          name: things
      testSchema:
        type: snowflake:Schema
        name: test_schema
        properties:
          name: things
          database: ${test.name}
      testSequence:
        type: snowflake:Sequence
        name: test_sequence
        properties:
          database: ${test.name}
          schema: ${testSchema.name}
          name: thing_counter
    

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

    Create Sequence Resource

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

    Constructor syntax

    new Sequence(name: string, args: SequenceArgs, opts?: CustomResourceOptions);
    @overload
    def Sequence(resource_name: str,
                 args: SequenceArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Sequence(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 database: Optional[str] = None,
                 schema: Optional[str] = None,
                 comment: Optional[str] = None,
                 increment: Optional[int] = None,
                 name: Optional[str] = None,
                 ordering: Optional[str] = None)
    func NewSequence(ctx *Context, name string, args SequenceArgs, opts ...ResourceOption) (*Sequence, error)
    public Sequence(string name, SequenceArgs args, CustomResourceOptions? opts = null)
    public Sequence(String name, SequenceArgs args)
    public Sequence(String name, SequenceArgs args, CustomResourceOptions options)
    
    type: snowflake:Sequence
    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 SequenceArgs
    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 SequenceArgs
    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 SequenceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SequenceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SequenceArgs
    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 sequenceResource = new Snowflake.Sequence("sequenceResource", new()
    {
        Database = "string",
        Schema = "string",
        Comment = "string",
        Increment = 0,
        Name = "string",
        Ordering = "string",
    });
    
    example, err := snowflake.NewSequence(ctx, "sequenceResource", &snowflake.SequenceArgs{
    	Database:  pulumi.String("string"),
    	Schema:    pulumi.String("string"),
    	Comment:   pulumi.String("string"),
    	Increment: pulumi.Int(0),
    	Name:      pulumi.String("string"),
    	Ordering:  pulumi.String("string"),
    })
    
    var sequenceResource = new Sequence("sequenceResource", SequenceArgs.builder()
        .database("string")
        .schema("string")
        .comment("string")
        .increment(0)
        .name("string")
        .ordering("string")
        .build());
    
    sequence_resource = snowflake.Sequence("sequenceResource",
        database="string",
        schema="string",
        comment="string",
        increment=0,
        name="string",
        ordering="string")
    
    const sequenceResource = new snowflake.Sequence("sequenceResource", {
        database: "string",
        schema: "string",
        comment: "string",
        increment: 0,
        name: "string",
        ordering: "string",
    });
    
    type: snowflake:Sequence
    properties:
        comment: string
        database: string
        increment: 0
        name: string
        ordering: string
        schema: string
    

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

    Database string
    The database in which to create the sequence. Don't use the | character.
    Schema string
    The schema in which to create the sequence. Don't use the | character.
    Comment string
    (Default: ``) Specifies a comment for the sequence.
    Increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    Ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    Database string
    The database in which to create the sequence. Don't use the | character.
    Schema string
    The schema in which to create the sequence. Don't use the | character.
    Comment string
    (Default: ``) Specifies a comment for the sequence.
    Increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    Ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    database String
    The database in which to create the sequence. Don't use the | character.
    schema String
    The schema in which to create the sequence. Don't use the | character.
    comment String
    (Default: ``) Specifies a comment for the sequence.
    increment Integer
    (Default: 1) The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    ordering String
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    database string
    The database in which to create the sequence. Don't use the | character.
    schema string
    The schema in which to create the sequence. Don't use the | character.
    comment string
    (Default: ``) Specifies a comment for the sequence.
    increment number
    (Default: 1) The amount the sequence will increase by each time it is used
    name string
    Specifies the name for the sequence.
    ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    database str
    The database in which to create the sequence. Don't use the | character.
    schema str
    The schema in which to create the sequence. Don't use the | character.
    comment str
    (Default: ``) Specifies a comment for the sequence.
    increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    name str
    Specifies the name for the sequence.
    ordering str
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    database String
    The database in which to create the sequence. Don't use the | character.
    schema String
    The schema in which to create the sequence. Don't use the | character.
    comment String
    (Default: ``) Specifies a comment for the sequence.
    increment Number
    (Default: 1) The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    ordering String
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.

    Outputs

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

    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    NextValue int
    The increment sequence interval.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Id string
    The provider-assigned unique ID for this managed resource.
    NextValue int
    The increment sequence interval.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    nextValue Integer
    The increment sequence interval.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    id string
    The provider-assigned unique ID for this managed resource.
    nextValue number
    The increment sequence interval.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    id str
    The provider-assigned unique ID for this managed resource.
    next_value int
    The increment sequence interval.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    id String
    The provider-assigned unique ID for this managed resource.
    nextValue Number
    The increment sequence interval.

    Look up Existing Sequence Resource

    Get an existing Sequence 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?: SequenceState, opts?: CustomResourceOptions): Sequence
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            database: Optional[str] = None,
            fully_qualified_name: Optional[str] = None,
            increment: Optional[int] = None,
            name: Optional[str] = None,
            next_value: Optional[int] = None,
            ordering: Optional[str] = None,
            schema: Optional[str] = None) -> Sequence
    func GetSequence(ctx *Context, name string, id IDInput, state *SequenceState, opts ...ResourceOption) (*Sequence, error)
    public static Sequence Get(string name, Input<string> id, SequenceState? state, CustomResourceOptions? opts = null)
    public static Sequence get(String name, Output<String> id, SequenceState state, CustomResourceOptions options)
    resources:  _:    type: snowflake:Sequence    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Comment string
    (Default: ``) Specifies a comment for the sequence.
    Database string
    The database in which to create the sequence. Don't use the | character.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    NextValue int
    The increment sequence interval.
    Ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    Schema string
    The schema in which to create the sequence. Don't use the | character.
    Comment string
    (Default: ``) Specifies a comment for the sequence.
    Database string
    The database in which to create the sequence. Don't use the | character.
    FullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    Increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    NextValue int
    The increment sequence interval.
    Ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    Schema string
    The schema in which to create the sequence. Don't use the | character.
    comment String
    (Default: ``) Specifies a comment for the sequence.
    database String
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    increment Integer
    (Default: 1) The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    nextValue Integer
    The increment sequence interval.
    ordering String
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    schema String
    The schema in which to create the sequence. Don't use the | character.
    comment string
    (Default: ``) Specifies a comment for the sequence.
    database string
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName string
    Fully qualified name of the resource. For more information, see object name resolution.
    increment number
    (Default: 1) The amount the sequence will increase by each time it is used
    name string
    Specifies the name for the sequence.
    nextValue number
    The increment sequence interval.
    ordering string
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    schema string
    The schema in which to create the sequence. Don't use the | character.
    comment str
    (Default: ``) Specifies a comment for the sequence.
    database str
    The database in which to create the sequence. Don't use the | character.
    fully_qualified_name str
    Fully qualified name of the resource. For more information, see object name resolution.
    increment int
    (Default: 1) The amount the sequence will increase by each time it is used
    name str
    Specifies the name for the sequence.
    next_value int
    The increment sequence interval.
    ordering str
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    schema str
    The schema in which to create the sequence. Don't use the | character.
    comment String
    (Default: ``) Specifies a comment for the sequence.
    database String
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName String
    Fully qualified name of the resource. For more information, see object name resolution.
    increment Number
    (Default: 1) The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    nextValue Number
    The increment sequence interval.
    ordering String
    (Default: ORDER) The ordering of the sequence. Either ORDER or NOORDER. Default is ORDER.
    schema String
    The schema in which to create the sequence. Don't use the | character.

    Import

    format is database name | schema name | sequence name

    $ pulumi import snowflake:index/sequence:Sequence example 'dbName|schemaName|sequenceName'
    

    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
    Viewing docs for Snowflake v2.13.0
    published on Thursday, Feb 26, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.