snowflake.Sequence
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";
const database = new snowflake.Database("database", {name: "things"});
const testSchema = new snowflake.Schema("test_schema", {
name: "things",
database: testDatabase.name,
});
const testSequence = new snowflake.Sequence("test_sequence", {
database: testDatabase.name,
schema: testSchema.name,
name: "thing_counter",
});
import pulumi
import pulumi_snowflake as snowflake
database = snowflake.Database("database", name="things")
test_schema = snowflake.Schema("test_schema",
name="things",
database=test_database["name"])
test_sequence = snowflake.Sequence("test_sequence",
database=test_database["name"],
schema=test_schema.name,
name="thing_counter")
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", &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: pulumi.Any(testDatabase.Name),
})
if err != nil {
return err
}
_, err = snowflake.NewSequence(ctx, "test_sequence", &snowflake.SequenceArgs{
Database: pulumi.Any(testDatabase.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 database = new Snowflake.Database("database", new()
{
Name = "things",
});
var testSchema = new Snowflake.Schema("test_schema", new()
{
Name = "things",
Database = testDatabase.Name,
});
var testSequence = new Snowflake.Sequence("test_sequence", new()
{
Database = testDatabase.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 database = new Database("database", DatabaseArgs.builder()
.name("things")
.build());
var testSchema = new Schema("testSchema", SchemaArgs.builder()
.name("things")
.database(testDatabase.name())
.build());
var testSequence = new Sequence("testSequence", SequenceArgs.builder()
.database(testDatabase.name())
.schema(testSchema.name())
.name("thing_counter")
.build());
}
}
resources:
database:
type: snowflake:Database
properties:
name: things
testSchema:
type: snowflake:Schema
name: test_schema
properties:
name: things
database: ${testDatabase.name}
testSequence:
type: snowflake:Sequence
name: test_sequence
properties:
database: ${testDatabase.name}
schema: ${testSchema.name}
name: thing_counter
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
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:
- Fully
Qualified stringName - The fully qualified name of the sequence.
- Id string
- The provider-assigned unique ID for this managed resource.
- Next
Value int - The increment sequence interval.
- Fully
Qualified stringName - The fully qualified name of the sequence.
- Id string
- The provider-assigned unique ID for this managed resource.
- Next
Value int - The increment sequence interval.
- fully
Qualified StringName - The fully qualified name of the sequence.
- id String
- The provider-assigned unique ID for this managed resource.
- next
Value Integer - The increment sequence interval.
- fully
Qualified stringName - The fully qualified name of the sequence.
- id string
- The provider-assigned unique ID for this managed resource.
- next
Value number - The increment sequence interval.
- fully_
qualified_ strname - 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.
- fully
Qualified StringName - The fully qualified name of the sequence.
- id String
- The provider-assigned unique ID for this managed resource.
- next
Value 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.
- Comment string
- Specifies a comment for the sequence.
- Database string
- The database in which to create the sequence. Don't use the | character.
- Fully
Qualified stringName - 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.
- Next
Value 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.
- Fully
Qualified stringName - 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.
- Next
Value 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.
- fully
Qualified StringName - 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.
- next
Value 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.
- fully
Qualified stringName - 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.
- next
Value 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_ strname - 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.
- fully
Qualified StringName - 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.
- next
Value 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.