Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Snowflake

v0.2.1 published on Monday, Sep 27, 2021 by Pulumi

Database

Import

 $ pulumi import snowflake:index/database:Database example name

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Snowflake.Database("test", new Snowflake.DatabaseArgs
        {
            Comment = "test comment",
            DataRetentionTimeInDays = 3,
        });
        var test2 = new Snowflake.Database("test2", new Snowflake.DatabaseArgs
        {
            Comment = "test comment 2",
        });
    }

}
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, "test", &snowflake.DatabaseArgs{
			Comment:                 pulumi.String("test comment"),
			DataRetentionTimeInDays: pulumi.Int(3),
		})
		if err != nil {
			return err
		}
		_, err = snowflake.NewDatabase(ctx, "test2", &snowflake.DatabaseArgs{
			Comment: pulumi.String("test comment 2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

test = snowflake.Database("test",
    comment="test comment",
    data_retention_time_in_days=3)
test2 = snowflake.Database("test2", comment="test comment 2")
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const test = new snowflake.Database("test", {
    comment: "test comment",
    dataRetentionTimeInDays: 3,
});
const test2 = new snowflake.Database("test2", {
    comment: "test comment 2",
});

Create a Database Resource

new Database(name: string, args?: DatabaseArgs, opts?: CustomResourceOptions);
@overload
def Database(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             comment: Optional[str] = None,
             data_retention_time_in_days: Optional[int] = None,
             from_database: Optional[str] = None,
             from_share: Optional[Mapping[str, Any]] = None,
             name: Optional[str] = None)
@overload
def Database(resource_name: str,
             args: Optional[DatabaseArgs] = None,
             opts: Optional[ResourceOptions] = None)
func NewDatabase(ctx *Context, name string, args *DatabaseArgs, opts ...ResourceOption) (*Database, error)
public Database(string name, DatabaseArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DatabaseArgs
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 DatabaseArgs
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 DatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Comment string
DataRetentionTimeInDays int
FromDatabase string
Specify a database to create a clone from.
FromShare Dictionary<string, object>
Specify a provider and a share in this map to create a database from a share.
Name string
Comment string
DataRetentionTimeInDays int
FromDatabase string
Specify a database to create a clone from.
FromShare map[string]interface{}
Specify a provider and a share in this map to create a database from a share.
Name string
comment string
dataRetentionTimeInDays number
fromDatabase string
Specify a database to create a clone from.
fromShare {[key: string]: any}
Specify a provider and a share in this map to create a database from a share.
name string
comment str
data_retention_time_in_days int
from_database str
Specify a database to create a clone from.
from_share Mapping[str, Any]
Specify a provider and a share in this map to create a database from a share.
name str

Outputs

All input properties are implicitly available as output properties. Additionally, the Database 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 Database Resource

Get an existing Database 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?: DatabaseState, opts?: CustomResourceOptions): Database
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        data_retention_time_in_days: Optional[int] = None,
        from_database: Optional[str] = None,
        from_share: Optional[Mapping[str, Any]] = None,
        name: Optional[str] = None) -> Database
func GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)
public static Database Get(string name, Input<string> id, DatabaseState? 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
DataRetentionTimeInDays int
FromDatabase string
Specify a database to create a clone from.
FromShare Dictionary<string, object>
Specify a provider and a share in this map to create a database from a share.
Name string
Comment string
DataRetentionTimeInDays int
FromDatabase string
Specify a database to create a clone from.
FromShare map[string]interface{}
Specify a provider and a share in this map to create a database from a share.
Name string
comment string
dataRetentionTimeInDays number
fromDatabase string
Specify a database to create a clone from.
fromShare {[key: string]: any}
Specify a provider and a share in this map to create a database from a share.
name string
comment str
data_retention_time_in_days int
from_database str
Specify a database to create a clone from.
from_share Mapping[str, Any]
Specify a provider and a share in this map to create a database from a share.
name str

Package Details

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