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

Snowflake

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

View

Import

format is database name | schema name | view name

 $ pulumi import snowflake:index/view:View example 'dbName|schemaName|viewName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var view = new Snowflake.View("view", new Snowflake.ViewArgs
        {
            Database = "db",
            Schema = "schema",
            Comment = "comment",
            Statement = @"select * from foo;
",
            OrReplace = false,
            IsSecure = 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.NewView(ctx, "view", &snowflake.ViewArgs{
			Database:  pulumi.String("db"),
			Schema:    pulumi.String("schema"),
			Comment:   pulumi.String("comment"),
			Statement: pulumi.String("select * from foo;\n"),
			OrReplace: pulumi.Bool(false),
			IsSecure:  pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

view = snowflake.View("view",
    database="db",
    schema="schema",
    comment="comment",
    statement="select * from foo;\n",
    or_replace=False,
    is_secure=False)
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const view = new snowflake.View("view", {
    database: "db",
    schema: "schema",
    comment: "comment",
    statement: "select * from foo;\n",
    orReplace: false,
    isSecure: false,
});

Create a View Resource

new View(name: string, args: ViewArgs, opts?: CustomResourceOptions);
@overload
def View(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         comment: Optional[str] = None,
         database: Optional[str] = None,
         is_secure: Optional[bool] = None,
         name: Optional[str] = None,
         or_replace: Optional[bool] = None,
         schema: Optional[str] = None,
         statement: Optional[str] = None)
@overload
def View(resource_name: str,
         args: ViewArgs,
         opts: Optional[ResourceOptions] = None)
func NewView(ctx *Context, name string, args ViewArgs, opts ...ResourceOption) (*View, error)
public View(string name, ViewArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ViewArgs
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 ViewArgs
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 ViewArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ViewArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Database string
The database in which to create the view. Don’t use the | character.
Schema string
The schema in which to create the view. Don’t use the | character.
Statement string
Specifies the query used to create the view.
Comment string
Specifies a comment for the view.
IsSecure bool
Specifies that the view is secure.
Name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
OrReplace bool
Overwrites the View if it exists.
Database string
The database in which to create the view. Don’t use the | character.
Schema string
The schema in which to create the view. Don’t use the | character.
Statement string
Specifies the query used to create the view.
Comment string
Specifies a comment for the view.
IsSecure bool
Specifies that the view is secure.
Name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
OrReplace bool
Overwrites the View if it exists.
database string
The database in which to create the view. Don’t use the | character.
schema string
The schema in which to create the view. Don’t use the | character.
statement string
Specifies the query used to create the view.
comment string
Specifies a comment for the view.
isSecure boolean
Specifies that the view is secure.
name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
orReplace boolean
Overwrites the View if it exists.
database str
The database in which to create the view. Don’t use the | character.
schema str
The schema in which to create the view. Don’t use the | character.
statement str
Specifies the query used to create the view.
comment str
Specifies a comment for the view.
is_secure bool
Specifies that the view is secure.
name str
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
or_replace bool
Overwrites the View if it exists.

Outputs

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

Get an existing View 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?: ViewState, opts?: CustomResourceOptions): View
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comment: Optional[str] = None,
        database: Optional[str] = None,
        is_secure: Optional[bool] = None,
        name: Optional[str] = None,
        or_replace: Optional[bool] = None,
        schema: Optional[str] = None,
        statement: Optional[str] = None) -> View
func GetView(ctx *Context, name string, id IDInput, state *ViewState, opts ...ResourceOption) (*View, error)
public static View Get(string name, Input<string> id, ViewState? 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 view.
Database string
The database in which to create the view. Don’t use the | character.
IsSecure bool
Specifies that the view is secure.
Name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
OrReplace bool
Overwrites the View if it exists.
Schema string
The schema in which to create the view. Don’t use the | character.
Statement string
Specifies the query used to create the view.
Comment string
Specifies a comment for the view.
Database string
The database in which to create the view. Don’t use the | character.
IsSecure bool
Specifies that the view is secure.
Name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
OrReplace bool
Overwrites the View if it exists.
Schema string
The schema in which to create the view. Don’t use the | character.
Statement string
Specifies the query used to create the view.
comment string
Specifies a comment for the view.
database string
The database in which to create the view. Don’t use the | character.
isSecure boolean
Specifies that the view is secure.
name string
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
orReplace boolean
Overwrites the View if it exists.
schema string
The schema in which to create the view. Don’t use the | character.
statement string
Specifies the query used to create the view.
comment str
Specifies a comment for the view.
database str
The database in which to create the view. Don’t use the | character.
is_secure bool
Specifies that the view is secure.
name str
Specifies the identifier for the view; must be unique for the schema in which the view is created. Don’t use the | character.
or_replace bool
Overwrites the View if it exists.
schema str
The schema in which to create the view. Don’t use the | character.
statement str
Specifies the query used to create the view.

Package Details

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