1. Packages
  2. Snowflake
  3. API Docs
  4. View
Snowflake v0.50.2 published on Friday, Mar 8, 2024 by Pulumi

snowflake.View

Explore with Pulumi AI

snowflake logo
Snowflake v0.50.2 published on Friday, Mar 8, 2024 by Pulumi

    Import

    format is database name | schema name | view name

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

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var view = new Snowflake.View("view", new()
        {
            Database = "database",
            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("database"),
    			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
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.View;
    import com.pulumi.snowflake.ViewArgs;
    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 view = new View("view", ViewArgs.builder()        
                .database("database")
                .schema("schema")
                .comment("comment")
                .statement("""
    select * from foo;
                """)
                .orReplace(false)
                .isSecure(false)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    view = snowflake.View("view",
        database="database",
        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: "database",
        schema: "schema",
        comment: "comment",
        statement: "select * from foo;\n",
        orReplace: false,
        isSecure: false,
    });
    
    resources:
      view:
        type: snowflake:View
        properties:
          database: database
          schema: schema
          comment: comment
          statement: |
            select * from foo;        
          orReplace: false
          isSecure: false
    

    Create View Resource

    new View(name: string, args: ViewArgs, opts?: CustomResourceOptions);
    @overload
    def View(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             comment: Optional[str] = None,
             copy_grants: Optional[bool] = 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[ViewTagArgs]] = 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)
    public View(String name, ViewArgs args)
    public View(String name, ViewArgs args, CustomResourceOptions options)
    
    type: snowflake:View
    properties: # The arguments to resource properties.
    options: # 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.
    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.
    name String
    The unique name of the resource.
    args ViewArgs
    The arguments to resource properties.
    options 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
    Name of the database that the tag was created in.
    Schema string
    Name of the schema that the tag was created in.
    Statement string
    Specifies the query used to create the view.
    Comment string
    Specifies a comment for the view.
    CopyGrants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    IsSecure bool
    Specifies that the view is secure.
    Name string
    Tag name, e.g. department.
    OrReplace bool
    Overwrites the View if it exists.
    Tags List<ViewTag>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    Database string
    Name of the database that the tag was created in.
    Schema string
    Name of the schema that the tag was created in.
    Statement string
    Specifies the query used to create the view.
    Comment string
    Specifies a comment for the view.
    CopyGrants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    IsSecure bool
    Specifies that the view is secure.
    Name string
    Tag name, e.g. department.
    OrReplace bool
    Overwrites the View if it exists.
    Tags []ViewTagArgs
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    database String
    Name of the database that the tag was created in.
    schema String
    Name of the schema that the tag was created in.
    statement String
    Specifies the query used to create the view.
    comment String
    Specifies a comment for the view.
    copyGrants Boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    isSecure Boolean
    Specifies that the view is secure.
    name String
    Tag name, e.g. department.
    orReplace Boolean
    Overwrites the View if it exists.
    tags List<ViewTag>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    database string
    Name of the database that the tag was created in.
    schema string
    Name of the schema that the tag was created in.
    statement string
    Specifies the query used to create the view.
    comment string
    Specifies a comment for the view.
    copyGrants boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    isSecure boolean
    Specifies that the view is secure.
    name string
    Tag name, e.g. department.
    orReplace boolean
    Overwrites the View if it exists.
    tags ViewTag[]
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    database str
    Name of the database that the tag was created in.
    schema str
    Name of the schema that the tag was created in.
    statement str
    Specifies the query used to create the view.
    comment str
    Specifies a comment for the view.
    copy_grants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    is_secure bool
    Specifies that the view is secure.
    name str
    Tag name, e.g. department.
    or_replace bool
    Overwrites the View if it exists.
    tags Sequence[ViewTagArgs]
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    database String
    Name of the database that the tag was created in.
    schema String
    Name of the schema that the tag was created in.
    statement String
    Specifies the query used to create the view.
    comment String
    Specifies a comment for the view.
    copyGrants Boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    isSecure Boolean
    Specifies that the view is secure.
    name String
    Tag name, e.g. department.
    orReplace Boolean
    Overwrites the View if it exists.
    tags List<Property Map>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the View resource produces the following output properties:

    CreatedOn string
    The timestamp at which the view was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    CreatedOn string
    The timestamp at which the view was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    createdOn String
    The timestamp at which the view was created.
    id String
    The provider-assigned unique ID for this managed resource.
    createdOn string
    The timestamp at which the view was created.
    id string
    The provider-assigned unique ID for this managed resource.
    created_on str
    The timestamp at which the view was created.
    id str
    The provider-assigned unique ID for this managed resource.
    createdOn String
    The timestamp at which the view was created.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up 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,
            copy_grants: Optional[bool] = None,
            created_on: 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[ViewTagArgs]] = 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)
    public static View get(String name, Output<String> id, ViewState 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.
    The following state arguments are supported:
    Comment string
    Specifies a comment for the view.
    CopyGrants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    CreatedOn string
    The timestamp at which the view was created.
    Database string
    Name of the database that the tag was created in.
    IsSecure bool
    Specifies that the view is secure.
    Name string
    Tag name, e.g. department.
    OrReplace bool
    Overwrites the View if it exists.
    Schema string
    Name of the schema that the tag was created in.
    Statement string
    Specifies the query used to create the view.
    Tags List<ViewTag>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    Comment string
    Specifies a comment for the view.
    CopyGrants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    CreatedOn string
    The timestamp at which the view was created.
    Database string
    Name of the database that the tag was created in.
    IsSecure bool
    Specifies that the view is secure.
    Name string
    Tag name, e.g. department.
    OrReplace bool
    Overwrites the View if it exists.
    Schema string
    Name of the schema that the tag was created in.
    Statement string
    Specifies the query used to create the view.
    Tags []ViewTagArgs
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    comment String
    Specifies a comment for the view.
    copyGrants Boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    createdOn String
    The timestamp at which the view was created.
    database String
    Name of the database that the tag was created in.
    isSecure Boolean
    Specifies that the view is secure.
    name String
    Tag name, e.g. department.
    orReplace Boolean
    Overwrites the View if it exists.
    schema String
    Name of the schema that the tag was created in.
    statement String
    Specifies the query used to create the view.
    tags List<ViewTag>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    comment string
    Specifies a comment for the view.
    copyGrants boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    createdOn string
    The timestamp at which the view was created.
    database string
    Name of the database that the tag was created in.
    isSecure boolean
    Specifies that the view is secure.
    name string
    Tag name, e.g. department.
    orReplace boolean
    Overwrites the View if it exists.
    schema string
    Name of the schema that the tag was created in.
    statement string
    Specifies the query used to create the view.
    tags ViewTag[]
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    comment str
    Specifies a comment for the view.
    copy_grants bool
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    created_on str
    The timestamp at which the view was created.
    database str
    Name of the database that the tag was created in.
    is_secure bool
    Specifies that the view is secure.
    name str
    Tag name, e.g. department.
    or_replace bool
    Overwrites the View if it exists.
    schema str
    Name of the schema that the tag was created in.
    statement str
    Specifies the query used to create the view.
    tags Sequence[ViewTagArgs]
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    comment String
    Specifies a comment for the view.
    copyGrants Boolean
    Retains the access permissions from the original view when a new view is created using the OR REPLACE clause. OR REPLACE must be set when COPY GRANTS is set.
    createdOn String
    The timestamp at which the view was created.
    database String
    Name of the database that the tag was created in.
    isSecure Boolean
    Specifies that the view is secure.
    name String
    Tag name, e.g. department.
    orReplace Boolean
    Overwrites the View if it exists.
    schema String
    Name of the schema that the tag was created in.
    statement String
    Specifies the query used to create the view.
    tags List<Property Map>
    Definitions of a tag to associate with the resource.

    Deprecated:Use the 'snowflake_tag_association' resource instead.

    Supporting Types

    ViewTag, ViewTagArgs

    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 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.
    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.

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v0.50.2 published on Friday, Mar 8, 2024 by Pulumi