Snowflake

v0.3.2 published on Tuesday, Nov 30, 2021 by Pulumi

Schema

Import

format is dbName | schemaName

 $ pulumi import snowflake:index/schema:Schema example 'dbName|schemaName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var schema = new Snowflake.Schema("schema", new Snowflake.SchemaArgs
        {
            Comment = "A schema.",
            DataRetentionDays = 1,
            Database = "db",
            IsManaged = false,
            IsTransient = false,
        });
    }

}
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.NewSchema(ctx, "schema", &snowflake.SchemaArgs{
			Comment:           pulumi.String("A schema."),
			DataRetentionDays: pulumi.Int(1),
			Database:          pulumi.String("db"),
			IsManaged:         pulumi.Bool(false),
			IsTransient:       pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

schema = snowflake.Schema("schema",
    comment="A schema.",
    data_retention_days=1,
    database="db",
    is_managed=False,
    is_transient=False)
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const schema = new snowflake.Schema("schema", {
    comment: "A schema.",
    dataRetentionDays: 1,
    database: "db",
    isManaged: false,
    isTransient: false,
});

Create a Schema Resource

new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
@overload
def Schema(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           comment: Optional[str] = None,
           data_retention_days: Optional[int] = None,
           database: Optional[str] = None,
           is_managed: Optional[bool] = None,
           is_transient: Optional[bool] = None,
           name: Optional[str] = None,
           tags: Optional[Sequence[SchemaTagArgs]] = None)
@overload
def Schema(resource_name: str,
           args: SchemaArgs,
           opts: Optional[ResourceOptions] = None)
func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args SchemaArgs
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 SchemaArgs
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 SchemaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Database string
The database in which to create the schema.
Comment string
Specifies a comment for the schema.
DataRetentionDays int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
IsManaged bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
IsTransient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
Name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
Tags List<SchemaTagArgs>
Definitions of a tag to associate with the resource.
Database string
The database in which to create the schema.
Comment string
Specifies a comment for the schema.
DataRetentionDays int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
IsManaged bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
IsTransient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
Name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
Tags []SchemaTagArgs
Definitions of a tag to associate with the resource.
database string
The database in which to create the schema.
comment string
Specifies a comment for the schema.
dataRetentionDays number
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
isManaged boolean
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
isTransient boolean
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
tags SchemaTagArgs[]
Definitions of a tag to associate with the resource.
database str
The database in which to create the schema.
comment str
Specifies a comment for the schema.
data_retention_days int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
is_managed bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
is_transient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
name str
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
tags Sequence[SchemaTagArgs]
Definitions of a tag to associate with the resource.

Outputs

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

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

Look up an Existing Schema Resource

Get an existing Schema 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?: SchemaState, opts?: CustomResourceOptions): Schema
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        data_retention_days: Optional[int] = None,
        database: Optional[str] = None,
        is_managed: Optional[bool] = None,
        is_transient: Optional[bool] = None,
        name: Optional[str] = None,
        tags: Optional[Sequence[SchemaTagArgs]] = None) -> Schema
func GetSchema(ctx *Context, name string, id IDInput, state *SchemaState, opts ...ResourceOption) (*Schema, error)
public static Schema Get(string name, Input<string> id, SchemaState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Comment string
Specifies a comment for the schema.
DataRetentionDays int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
Database string
The database in which to create the schema.
IsManaged bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
IsTransient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
Name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
Tags List<SchemaTagArgs>
Definitions of a tag to associate with the resource.
Comment string
Specifies a comment for the schema.
DataRetentionDays int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
Database string
The database in which to create the schema.
IsManaged bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
IsTransient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
Name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
Tags []SchemaTagArgs
Definitions of a tag to associate with the resource.
comment string
Specifies a comment for the schema.
dataRetentionDays number
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
database string
The database in which to create the schema.
isManaged boolean
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
isTransient boolean
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
name string
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
tags SchemaTagArgs[]
Definitions of a tag to associate with the resource.
comment str
Specifies a comment for the schema.
data_retention_days int
Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema, as well as specifying the default Time Travel retention time for all tables created in the schema.
database str
The database in which to create the schema.
is_managed bool
Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
is_transient bool
Specifies a schema as transient. Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel; however, this means they are also not protected by Fail-safe in the event of a data loss.
name str
Specifies the identifier for the schema; must be unique for the database in which the schema is created.
tags Sequence[SchemaTagArgs]
Definitions of a tag to associate with the resource.

Supporting Types

SchemaTag

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.

Package Details

Repository
https://github.com/pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.