snowflake.Schema
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";
const schema = new snowflake.Schema("schema", {
database: "database",
name: "schema",
comment: "A schema.",
isTransient: false,
isManaged: false,
dataRetentionDays: 1,
});
import pulumi
import pulumi_snowflake as snowflake
schema = snowflake.Schema("schema",
database="database",
name="schema",
comment="A schema.",
is_transient=False,
is_managed=False,
data_retention_days=1)
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{
Database: pulumi.String("database"),
Name: pulumi.String("schema"),
Comment: pulumi.String("A schema."),
IsTransient: pulumi.Bool(false),
IsManaged: pulumi.Bool(false),
DataRetentionDays: pulumi.Int(1),
})
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",
Comment = "A schema.",
IsTransient = false,
IsManaged = false,
DataRetentionDays = 1,
});
});
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 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")
.comment("A schema.")
.isTransient(false)
.isManaged(false)
.dataRetentionDays(1)
.build());
}
}
resources:
schema:
type: snowflake:Schema
properties:
database: database
name: schema
comment: A schema.
isTransient: false
isManaged: false
dataRetentionDays: 1
Create Schema Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
@overload
def Schema(resource_name: str,
args: SchemaArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Schema(resource_name: str,
opts: Optional[ResourceOptions] = None,
database: Optional[str] = None,
comment: Optional[str] = None,
data_retention_days: Optional[int] = None,
is_managed: Optional[bool] = None,
is_transient: Optional[bool] = None,
name: Optional[str] = None,
tags: Optional[Sequence[SchemaTagArgs]] = None)
func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
public Schema(String name, SchemaArgs args)
public Schema(String name, SchemaArgs args, CustomResourceOptions options)
type: snowflake:Schema
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 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.
- name String
- The unique name of the resource.
- args SchemaArgs
- 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 schemaResource = new Snowflake.Schema("schemaResource", new()
{
Database = "string",
Comment = "string",
DataRetentionDays = 0,
IsManaged = false,
IsTransient = false,
Name = "string",
});
example, err := snowflake.NewSchema(ctx, "schemaResource", &snowflake.SchemaArgs{
Database: pulumi.String("string"),
Comment: pulumi.String("string"),
DataRetentionDays: pulumi.Int(0),
IsManaged: pulumi.Bool(false),
IsTransient: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var schemaResource = new Schema("schemaResource", SchemaArgs.builder()
.database("string")
.comment("string")
.dataRetentionDays(0)
.isManaged(false)
.isTransient(false)
.name("string")
.build());
schema_resource = snowflake.Schema("schemaResource",
database="string",
comment="string",
data_retention_days=0,
is_managed=False,
is_transient=False,
name="string")
const schemaResource = new snowflake.Schema("schemaResource", {
database: "string",
comment: "string",
dataRetentionDays: 0,
isManaged: false,
isTransient: false,
name: "string",
});
type: snowflake:Schema
properties:
comment: string
dataRetentionDays: 0
database: string
isManaged: false
isTransient: false
name: string
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.
- Data
Retention intDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- 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 string
- Specifies the identifier for the schema; must be unique for the database in which the schema is created.
- List<Schema
Tag> - 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.
- Data
Retention intDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- 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 string
- Specifies the identifier for the schema; must be unique for the database in which the schema is created.
- []Schema
Tag Args - 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.
- data
Retention IntegerDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- is
Managed Boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- List<Schema
Tag> - 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.
- data
Retention numberDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- is
Managed boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- Schema
Tag[] - 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_ intdays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- 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.
- Sequence[Schema
Tag Args] - 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.
- data
Retention NumberDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- is
Managed Boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- List<Property Map>
- 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up 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)
public static Schema get(String name, Output<String> id, SchemaState 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 schema.
- Data
Retention intDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- Database string
- 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 string
- Specifies the identifier for the schema; must be unique for the database in which the schema is created.
- List<Schema
Tag> - Definitions of a tag to associate with the resource.
- Comment string
- Specifies a comment for the schema.
- Data
Retention intDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- Database string
- 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 string
- Specifies the identifier for the schema; must be unique for the database in which the schema is created.
- []Schema
Tag Args - Definitions of a tag to associate with the resource.
- comment String
- Specifies a comment for the schema.
- data
Retention IntegerDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- database String
- The database in which to create the schema.
- is
Managed Boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- List<Schema
Tag> - Definitions of a tag to associate with the resource.
- comment string
- Specifies a comment for the schema.
- data
Retention numberDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- database string
- The database in which to create the schema.
- is
Managed boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- Schema
Tag[] - Definitions of a tag to associate with the resource.
- comment str
- Specifies a comment for the schema.
- data_
retention_ intdays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- 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.
- Sequence[Schema
Tag Args] - Definitions of a tag to associate with the resource.
- comment String
- Specifies a comment for the schema.
- data
Retention NumberDays - 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. Default value for this field is set to -1, which is a fallback to use Snowflake default.
- database String
- The database in which to create the schema.
- is
Managed Boolean - Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner.
- is
Transient 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.
- List<Property Map>
- Definitions of a tag to associate with the resource.
Supporting Types
SchemaTag, SchemaTagArgs
Import
format is dbName | schemaName
$ pulumi import snowflake:index/schema:Schema example 'dbName|schemaName'
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.