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

Snowflake

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

Stage

Import

format is database name | schema name | stage name

 $ pulumi import snowflake:index/stage:Stage example 'dbName|schemaName|stageName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleStage = new Snowflake.Stage("exampleStage", new Snowflake.StageArgs
        {
            Url = "s3://com.example.bucket/prefix",
            Database = "EXAMPLE_DB",
            Schema = "EXAMPLE_SCHEMA",
            Credentials = $"AWS_KEY_ID='{@var.Example_aws_key_id}' AWS_SECRET_KEY='{@var.Example_aws_secret_key}'",
        });
        var grantExampleStage = new Snowflake.StageGrant("grantExampleStage", new Snowflake.StageGrantArgs
        {
            DatabaseName = exampleStage.Database,
            SchemaName = exampleStage.Schema,
            Roles = 
            {
                "LOADER",
            },
            Privilege = "OWNERSHIP",
            StageName = exampleStage.Name,
        });
    }

}
package main

import (
	"fmt"

	"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 {
		exampleStage, err := snowflake.NewStage(ctx, "exampleStage", &snowflake.StageArgs{
			Url:         pulumi.String("s3://com.example.bucket/prefix"),
			Database:    pulumi.String("EXAMPLE_DB"),
			Schema:      pulumi.String("EXAMPLE_SCHEMA"),
			Credentials: pulumi.String(fmt.Sprintf("%v%v%v%v%v", "AWS_KEY_ID='", _var.Example_aws_key_id, "' AWS_SECRET_KEY='", _var.Example_aws_secret_key, "'")),
		})
		if err != nil {
			return err
		}
		_, err = snowflake.NewStageGrant(ctx, "grantExampleStage", &snowflake.StageGrantArgs{
			DatabaseName: exampleStage.Database,
			SchemaName:   exampleStage.Schema,
			Roles: pulumi.StringArray{
				pulumi.String("LOADER"),
			},
			Privilege: pulumi.String("OWNERSHIP"),
			StageName: exampleStage.Name,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

example_stage = snowflake.Stage("exampleStage",
    url="s3://com.example.bucket/prefix",
    database="EXAMPLE_DB",
    schema="EXAMPLE_SCHEMA",
    credentials=f"AWS_KEY_ID='{var['example_aws_key_id']}' AWS_SECRET_KEY='{var['example_aws_secret_key']}'")
grant_example_stage = snowflake.StageGrant("grantExampleStage",
    database_name=example_stage.database,
    schema_name=example_stage.schema,
    roles=["LOADER"],
    privilege="OWNERSHIP",
    stage_name=example_stage.name)
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const exampleStage = new snowflake.Stage("exampleStage", {
    url: "s3://com.example.bucket/prefix",
    database: "EXAMPLE_DB",
    schema: "EXAMPLE_SCHEMA",
    credentials: `AWS_KEY_ID='${_var.example_aws_key_id}' AWS_SECRET_KEY='${_var.example_aws_secret_key}'`,
});
const grantExampleStage = new snowflake.StageGrant("grantExampleStage", {
    databaseName: exampleStage.database,
    schemaName: exampleStage.schema,
    roles: ["LOADER"],
    privilege: "OWNERSHIP",
    stageName: exampleStage.name,
});

Create a Stage Resource

new Stage(name: string, args: StageArgs, opts?: CustomResourceOptions);
@overload
def Stage(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          aws_external_id: Optional[str] = None,
          comment: Optional[str] = None,
          copy_options: Optional[str] = None,
          credentials: Optional[str] = None,
          database: Optional[str] = None,
          encryption: Optional[str] = None,
          file_format: Optional[str] = None,
          name: Optional[str] = None,
          schema: Optional[str] = None,
          snowflake_iam_user: Optional[str] = None,
          storage_integration: Optional[str] = None,
          url: Optional[str] = None)
@overload
def Stage(resource_name: str,
          args: StageArgs,
          opts: Optional[ResourceOptions] = None)
func NewStage(ctx *Context, name string, args StageArgs, opts ...ResourceOption) (*Stage, error)
public Stage(string name, StageArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args StageArgs
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 StageArgs
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 StageArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StageArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Database string
The database in which to create the stage.
Schema string
The schema in which to create the stage.
AwsExternalId string
Comment string
Specifies a comment for the stage.
CopyOptions string
Specifies the copy options for the stage.
Credentials string
Specifies the credentials for the stage.
Encryption string
Specifies the encryption settings for the stage.
FileFormat string
Specifies the file format for the stage.
Name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
SnowflakeIamUser string
StorageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
Url string
Specifies the URL for the stage.
Database string
The database in which to create the stage.
Schema string
The schema in which to create the stage.
AwsExternalId string
Comment string
Specifies a comment for the stage.
CopyOptions string
Specifies the copy options for the stage.
Credentials string
Specifies the credentials for the stage.
Encryption string
Specifies the encryption settings for the stage.
FileFormat string
Specifies the file format for the stage.
Name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
SnowflakeIamUser string
StorageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
Url string
Specifies the URL for the stage.
database string
The database in which to create the stage.
schema string
The schema in which to create the stage.
awsExternalId string
comment string
Specifies a comment for the stage.
copyOptions string
Specifies the copy options for the stage.
credentials string
Specifies the credentials for the stage.
encryption string
Specifies the encryption settings for the stage.
fileFormat string
Specifies the file format for the stage.
name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
snowflakeIamUser string
storageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
url string
Specifies the URL for the stage.
database str
The database in which to create the stage.
schema str
The schema in which to create the stage.
aws_external_id str
comment str
Specifies a comment for the stage.
copy_options str
Specifies the copy options for the stage.
credentials str
Specifies the credentials for the stage.
encryption str
Specifies the encryption settings for the stage.
file_format str
Specifies the file format for the stage.
name str
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
snowflake_iam_user str
storage_integration str
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
url str
Specifies the URL for the stage.

Outputs

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

Get an existing Stage 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?: StageState, opts?: CustomResourceOptions): Stage
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aws_external_id: Optional[str] = None,
        comment: Optional[str] = None,
        copy_options: Optional[str] = None,
        credentials: Optional[str] = None,
        database: Optional[str] = None,
        encryption: Optional[str] = None,
        file_format: Optional[str] = None,
        name: Optional[str] = None,
        schema: Optional[str] = None,
        snowflake_iam_user: Optional[str] = None,
        storage_integration: Optional[str] = None,
        url: Optional[str] = None) -> Stage
func GetStage(ctx *Context, name string, id IDInput, state *StageState, opts ...ResourceOption) (*Stage, error)
public static Stage Get(string name, Input<string> id, StageState? 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:

AwsExternalId string
Comment string
Specifies a comment for the stage.
CopyOptions string
Specifies the copy options for the stage.
Credentials string
Specifies the credentials for the stage.
Database string
The database in which to create the stage.
Encryption string
Specifies the encryption settings for the stage.
FileFormat string
Specifies the file format for the stage.
Name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
Schema string
The schema in which to create the stage.
SnowflakeIamUser string
StorageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
Url string
Specifies the URL for the stage.
AwsExternalId string
Comment string
Specifies a comment for the stage.
CopyOptions string
Specifies the copy options for the stage.
Credentials string
Specifies the credentials for the stage.
Database string
The database in which to create the stage.
Encryption string
Specifies the encryption settings for the stage.
FileFormat string
Specifies the file format for the stage.
Name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
Schema string
The schema in which to create the stage.
SnowflakeIamUser string
StorageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
Url string
Specifies the URL for the stage.
awsExternalId string
comment string
Specifies a comment for the stage.
copyOptions string
Specifies the copy options for the stage.
credentials string
Specifies the credentials for the stage.
database string
The database in which to create the stage.
encryption string
Specifies the encryption settings for the stage.
fileFormat string
Specifies the file format for the stage.
name string
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
schema string
The schema in which to create the stage.
snowflakeIamUser string
storageIntegration string
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
url string
Specifies the URL for the stage.
aws_external_id str
comment str
Specifies a comment for the stage.
copy_options str
Specifies the copy options for the stage.
credentials str
Specifies the credentials for the stage.
database str
The database in which to create the stage.
encryption str
Specifies the encryption settings for the stage.
file_format str
Specifies the file format for the stage.
name str
Specifies the identifier for the stage; must be unique for the database and schema in which the stage is created.
schema str
The schema in which to create the stage.
snowflake_iam_user str
storage_integration str
Specifies the name of the storage integration used to delegate authentication responsibility for external cloud storage to a Snowflake identity and access management (IAM) entity.
url str
Specifies the URL for the stage.

Package Details

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