Snowflake

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

MaterializedView

Import

format is database name | schema name | view name

 $ pulumi import snowflake:index/materializedView:MaterializedView example 'dbName|schemaName|viewName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var view = new Snowflake.MaterializedView("view", new Snowflake.MaterializedViewArgs
        {
            Database = "db",
            Schema = "schema",
            Warehouse = "warehouse",
            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.NewMaterializedView(ctx, "view", &snowflake.MaterializedViewArgs{
			Database:  pulumi.String("db"),
			Schema:    pulumi.String("schema"),
			Warehouse: pulumi.String("warehouse"),
			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.MaterializedView("view",
    database="db",
    schema="schema",
    warehouse="warehouse",
    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.MaterializedView("view", {
    database: "db",
    schema: "schema",
    warehouse: "warehouse",
    comment: "comment",
    statement: "select * from foo;\n",
    orReplace: false,
    isSecure: false,
});

Create a MaterializedView Resource

new MaterializedView(name: string, args: MaterializedViewArgs, opts?: CustomResourceOptions);
@overload
def MaterializedView(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,
                     tags: Optional[Sequence[MaterializedViewTagArgs]] = None,
                     warehouse: Optional[str] = None)
@overload
def MaterializedView(resource_name: str,
                     args: MaterializedViewArgs,
                     opts: Optional[ResourceOptions] = None)
func NewMaterializedView(ctx *Context, name string, args MaterializedViewArgs, opts ...ResourceOption) (*MaterializedView, error)
public MaterializedView(string name, MaterializedViewArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args MaterializedViewArgs
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 MaterializedViewArgs
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 MaterializedViewArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MaterializedViewArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MaterializedView 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 MaterializedView 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.
Warehouse string
The warehouse name.
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.
OrReplace bool
Overwrites the View if it exists.
Tags List<MaterializedViewTagArgs>
Definitions of a tag to associate with the resource.
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.
Warehouse string
The warehouse name.
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.
OrReplace bool
Overwrites the View if it exists.
Tags []MaterializedViewTagArgs
Definitions of a tag to associate with the resource.
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.
warehouse string
The warehouse name.
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.
orReplace boolean
Overwrites the View if it exists.
tags MaterializedViewTagArgs[]
Definitions of a tag to associate with the resource.
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.
warehouse str
The warehouse name.
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.
or_replace bool
Overwrites the View if it exists.
tags Sequence[MaterializedViewTagArgs]
Definitions of a tag to associate with the resource.

Outputs

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

Get an existing MaterializedView 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?: MaterializedViewState, opts?: CustomResourceOptions): MaterializedView
@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,
        tags: Optional[Sequence[MaterializedViewTagArgs]] = None,
        warehouse: Optional[str] = None) -> MaterializedView
func GetMaterializedView(ctx *Context, name string, id IDInput, state *MaterializedViewState, opts ...ResourceOption) (*MaterializedView, error)
public static MaterializedView Get(string name, Input<string> id, MaterializedViewState? 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.
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.
Tags List<MaterializedViewTagArgs>
Definitions of a tag to associate with the resource.
Warehouse string
The warehouse name.
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.
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.
Tags []MaterializedViewTagArgs
Definitions of a tag to associate with the resource.
Warehouse string
The warehouse name.
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.
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.
tags MaterializedViewTagArgs[]
Definitions of a tag to associate with the resource.
warehouse string
The warehouse name.
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.
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.
tags Sequence[MaterializedViewTagArgs]
Definitions of a tag to associate with the resource.
warehouse str
The warehouse name.

Supporting Types

MaterializedViewTag

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.