1. Packages
  2. Snowflake
  3. API Docs
  4. Sequence
Snowflake v0.52.0 published on Thursday, Apr 18, 2024 by Pulumi

snowflake.Sequence

Explore with Pulumi AI

snowflake logo
Snowflake v0.52.0 published on Thursday, Apr 18, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const database = new snowflake.Database("database", {});
    const testSchema = new snowflake.Schema("testSchema", {database: snowflake_database.test_database.name});
    const testSequence = new snowflake.Sequence("testSequence", {
        database: snowflake_database.test_database.name,
        schema: testSchema.name,
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    database = snowflake.Database("database")
    test_schema = snowflake.Schema("testSchema", database=snowflake_database["test_database"]["name"])
    test_sequence = snowflake.Sequence("testSequence",
        database=snowflake_database["test_database"]["name"],
        schema=test_schema.name)
    
    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 {
    		_, err := snowflake.NewDatabase(ctx, "database", nil)
    		if err != nil {
    			return err
    		}
    		testSchema, err := snowflake.NewSchema(ctx, "testSchema", &snowflake.SchemaArgs{
    			Database: pulumi.Any(snowflake_database.Test_database.Name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.NewSequence(ctx, "testSequence", &snowflake.SequenceArgs{
    			Database: pulumi.Any(snowflake_database.Test_database.Name),
    			Schema:   testSchema.Name,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var database = new Snowflake.Database("database");
    
        var testSchema = new Snowflake.Schema("testSchema", new()
        {
            Database = snowflake_database.Test_database.Name,
        });
    
        var testSequence = new Snowflake.Sequence("testSequence", new()
        {
            Database = snowflake_database.Test_database.Name,
            Schema = testSchema.Name,
        });
    
    });
    
    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.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 database = new Database("database");
    
            var testSchema = new Schema("testSchema", SchemaArgs.builder()        
                .database(snowflake_database.test_database().name())
                .build());
    
            var testSequence = new Sequence("testSequence", SequenceArgs.builder()        
                .database(snowflake_database.test_database().name())
                .schema(testSchema.name())
                .build());
    
        }
    }
    
    resources:
      database:
        type: snowflake:Database
      testSchema:
        type: snowflake:Schema
        properties:
          database: ${snowflake_database.test_database.name}
      testSequence:
        type: snowflake:Sequence
        properties:
          database: ${snowflake_database.test_database.name}
          schema: ${testSchema.name}
    

    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.

    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

    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
    Specifies a comment for the sequence.
    Increment int
    The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    Ordering string
    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
    Specifies a comment for the sequence.
    Increment int
    The amount the sequence will increase by each time it is used
    Name string
    Specifies the name for the sequence.
    Ordering string
    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
    Specifies a comment for the sequence.
    increment Integer
    The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    ordering String
    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
    Specifies a comment for the sequence.
    increment number
    The amount the sequence will increase by each time it is used
    name string
    Specifies the name for the sequence.
    ordering string
    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
    Specifies a comment for the sequence.
    increment int
    The amount the sequence will increase by each time it is used
    name str
    Specifies the name for the sequence.
    ordering str
    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
    Specifies a comment for the sequence.
    increment Number
    The amount the sequence will increase by each time it is used
    name String
    Specifies the name for the sequence.
    ordering String
    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
    The fully qualified name of the sequence.
    Id string
    The provider-assigned unique ID for this managed resource.
    NextValue int
    The increment sequence interval.
    FullyQualifiedName string
    The fully qualified name of the sequence.
    Id string
    The provider-assigned unique ID for this managed resource.
    NextValue int
    The increment sequence interval.
    fullyQualifiedName String
    The fully qualified name of the sequence.
    id String
    The provider-assigned unique ID for this managed resource.
    nextValue Integer
    The increment sequence interval.
    fullyQualifiedName string
    The fully qualified name of the sequence.
    id string
    The provider-assigned unique ID for this managed resource.
    nextValue number
    The increment sequence interval.
    fully_qualified_name str
    The fully qualified name of the sequence.
    id str
    The provider-assigned unique ID for this managed resource.
    next_value int
    The increment sequence interval.
    fullyQualifiedName String
    The fully qualified name of the sequence.
    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)
    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:
    Comment string
    Specifies a comment for the sequence.
    Database string
    The database in which to create the sequence. Don't use the | character.
    FullyQualifiedName string
    The fully qualified name of the sequence.
    Increment int
    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
    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
    Specifies a comment for the sequence.
    Database string
    The database in which to create the sequence. Don't use the | character.
    FullyQualifiedName string
    The fully qualified name of the sequence.
    Increment int
    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
    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
    Specifies a comment for the sequence.
    database String
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName String
    The fully qualified name of the sequence.
    increment Integer
    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
    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
    Specifies a comment for the sequence.
    database string
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName string
    The fully qualified name of the sequence.
    increment number
    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
    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
    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
    The fully qualified name of the sequence.
    increment int
    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
    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
    Specifies a comment for the sequence.
    database String
    The database in which to create the sequence. Don't use the | character.
    fullyQualifiedName String
    The fully qualified name of the sequence.
    increment Number
    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
    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
    Snowflake v0.52.0 published on Thursday, Apr 18, 2024 by Pulumi