Snowflake

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

ExternalTable

Import

format is database name | schema name | external table name

 $ pulumi import snowflake:index/externalTable:ExternalTable example 'dbName|schemaName|externalTableName'

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var externalTable = new Snowflake.ExternalTable("externalTable", new Snowflake.ExternalTableArgs
        {
            Columns = 
            {
                new Snowflake.Inputs.ExternalTableColumnArgs
                {
                    Name = "id",
                    Type = "int",
                },
                new Snowflake.Inputs.ExternalTableColumnArgs
                {
                    Name = "data",
                    Type = "text",
                },
            },
            Comment = "External table",
            Database = "db",
            Schema = "schema",
        });
    }

}
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.NewExternalTable(ctx, "externalTable", &snowflake.ExternalTableArgs{
			Columns: ExternalTableColumnArray{
				&ExternalTableColumnArgs{
					Name: pulumi.String("id"),
					Type: pulumi.String("int"),
				},
				&ExternalTableColumnArgs{
					Name: pulumi.String("data"),
					Type: pulumi.String("text"),
				},
			},
			Comment:  pulumi.String("External table"),
			Database: pulumi.String("db"),
			Schema:   pulumi.String("schema"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

external_table = snowflake.ExternalTable("externalTable",
    columns=[
        snowflake.ExternalTableColumnArgs(
            name="id",
            type="int",
        ),
        snowflake.ExternalTableColumnArgs(
            name="data",
            type="text",
        ),
    ],
    comment="External table",
    database="db",
    schema="schema")
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const externalTable = new snowflake.ExternalTable("external_table", {
    columns: [
        {
            name: "id",
            type: "int",
        },
        {
            name: "data",
            type: "text",
        },
    ],
    comment: "External table",
    database: "db",
    schema: "schema",
});

Create a ExternalTable Resource

new ExternalTable(name: string, args: ExternalTableArgs, opts?: CustomResourceOptions);
@overload
def ExternalTable(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  auto_refresh: Optional[bool] = None,
                  aws_sns_topic: Optional[str] = None,
                  columns: Optional[Sequence[ExternalTableColumnArgs]] = None,
                  comment: Optional[str] = None,
                  copy_grants: Optional[bool] = None,
                  database: Optional[str] = None,
                  file_format: Optional[str] = None,
                  location: Optional[str] = None,
                  name: Optional[str] = None,
                  partition_bies: Optional[Sequence[str]] = None,
                  pattern: Optional[str] = None,
                  refresh_on_create: Optional[bool] = None,
                  schema: Optional[str] = None,
                  tags: Optional[Sequence[ExternalTableTagArgs]] = None)
@overload
def ExternalTable(resource_name: str,
                  args: ExternalTableArgs,
                  opts: Optional[ResourceOptions] = None)
func NewExternalTable(ctx *Context, name string, args ExternalTableArgs, opts ...ResourceOption) (*ExternalTable, error)
public ExternalTable(string name, ExternalTableArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ExternalTableArgs
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 ExternalTableArgs
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 ExternalTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ExternalTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Columns List<ExternalTableColumnArgs>
Definitions of a column to create in the external table. Minimum one required.
Database string
The database in which to create the external table.
FileFormat string
Specifies the file format for the external table.
Location string
Specifies a location for the external table.
Schema string
The schema in which to create the external table.
AutoRefresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
AwsSnsTopic string
Specifies the aws sns topic for the external table.
Comment string
Specifies a comment for the external table.
CopyGrants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
Name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
PartitionBies List<string>
Specifies any partition columns to evaluate for the external table.
Pattern string
Specifies the file names and/or paths on the external stage to match.
RefreshOnCreate bool
Specifies weather to refresh when an external table is created.
Tags List<ExternalTableTagArgs>
Definitions of a tag to associate with the resource.
Columns []ExternalTableColumnArgs
Definitions of a column to create in the external table. Minimum one required.
Database string
The database in which to create the external table.
FileFormat string
Specifies the file format for the external table.
Location string
Specifies a location for the external table.
Schema string
The schema in which to create the external table.
AutoRefresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
AwsSnsTopic string
Specifies the aws sns topic for the external table.
Comment string
Specifies a comment for the external table.
CopyGrants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
Name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
PartitionBies []string
Specifies any partition columns to evaluate for the external table.
Pattern string
Specifies the file names and/or paths on the external stage to match.
RefreshOnCreate bool
Specifies weather to refresh when an external table is created.
Tags []ExternalTableTagArgs
Definitions of a tag to associate with the resource.
columns ExternalTableColumnArgs[]
Definitions of a column to create in the external table. Minimum one required.
database string
The database in which to create the external table.
fileFormat string
Specifies the file format for the external table.
location string
Specifies a location for the external table.
schema string
The schema in which to create the external table.
autoRefresh boolean
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
awsSnsTopic string
Specifies the aws sns topic for the external table.
comment string
Specifies a comment for the external table.
copyGrants boolean
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
partitionBies string[]
Specifies any partition columns to evaluate for the external table.
pattern string
Specifies the file names and/or paths on the external stage to match.
refreshOnCreate boolean
Specifies weather to refresh when an external table is created.
tags ExternalTableTagArgs[]
Definitions of a tag to associate with the resource.
columns Sequence[ExternalTableColumnArgs]
Definitions of a column to create in the external table. Minimum one required.
database str
The database in which to create the external table.
file_format str
Specifies the file format for the external table.
location str
Specifies a location for the external table.
schema str
The schema in which to create the external table.
auto_refresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
aws_sns_topic str
Specifies the aws sns topic for the external table.
comment str
Specifies a comment for the external table.
copy_grants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
name str
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
partition_bies Sequence[str]
Specifies any partition columns to evaluate for the external table.
pattern str
Specifies the file names and/or paths on the external stage to match.
refresh_on_create bool
Specifies weather to refresh when an external table is created.
tags Sequence[ExternalTableTagArgs]
Definitions of a tag to associate with the resource.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Owner string
Name of the role that owns the external table.
Id string
The provider-assigned unique ID for this managed resource.
Owner string
Name of the role that owns the external table.
id string
The provider-assigned unique ID for this managed resource.
owner string
Name of the role that owns the external table.
id str
The provider-assigned unique ID for this managed resource.
owner str
Name of the role that owns the external table.

Look up an Existing ExternalTable Resource

Get an existing ExternalTable 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?: ExternalTableState, opts?: CustomResourceOptions): ExternalTable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_refresh: Optional[bool] = None,
        aws_sns_topic: Optional[str] = None,
        columns: Optional[Sequence[ExternalTableColumnArgs]] = None,
        comment: Optional[str] = None,
        copy_grants: Optional[bool] = None,
        database: Optional[str] = None,
        file_format: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        owner: Optional[str] = None,
        partition_bies: Optional[Sequence[str]] = None,
        pattern: Optional[str] = None,
        refresh_on_create: Optional[bool] = None,
        schema: Optional[str] = None,
        tags: Optional[Sequence[ExternalTableTagArgs]] = None) -> ExternalTable
func GetExternalTable(ctx *Context, name string, id IDInput, state *ExternalTableState, opts ...ResourceOption) (*ExternalTable, error)
public static ExternalTable Get(string name, Input<string> id, ExternalTableState? 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:

AutoRefresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
AwsSnsTopic string
Specifies the aws sns topic for the external table.
Columns List<ExternalTableColumnArgs>
Definitions of a column to create in the external table. Minimum one required.
Comment string
Specifies a comment for the external table.
CopyGrants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
Database string
The database in which to create the external table.
FileFormat string
Specifies the file format for the external table.
Location string
Specifies a location for the external table.
Name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
Owner string
Name of the role that owns the external table.
PartitionBies List<string>
Specifies any partition columns to evaluate for the external table.
Pattern string
Specifies the file names and/or paths on the external stage to match.
RefreshOnCreate bool
Specifies weather to refresh when an external table is created.
Schema string
The schema in which to create the external table.
Tags List<ExternalTableTagArgs>
Definitions of a tag to associate with the resource.
AutoRefresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
AwsSnsTopic string
Specifies the aws sns topic for the external table.
Columns []ExternalTableColumnArgs
Definitions of a column to create in the external table. Minimum one required.
Comment string
Specifies a comment for the external table.
CopyGrants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
Database string
The database in which to create the external table.
FileFormat string
Specifies the file format for the external table.
Location string
Specifies a location for the external table.
Name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
Owner string
Name of the role that owns the external table.
PartitionBies []string
Specifies any partition columns to evaluate for the external table.
Pattern string
Specifies the file names and/or paths on the external stage to match.
RefreshOnCreate bool
Specifies weather to refresh when an external table is created.
Schema string
The schema in which to create the external table.
Tags []ExternalTableTagArgs
Definitions of a tag to associate with the resource.
autoRefresh boolean
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
awsSnsTopic string
Specifies the aws sns topic for the external table.
columns ExternalTableColumnArgs[]
Definitions of a column to create in the external table. Minimum one required.
comment string
Specifies a comment for the external table.
copyGrants boolean
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
database string
The database in which to create the external table.
fileFormat string
Specifies the file format for the external table.
location string
Specifies a location for the external table.
name string
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
owner string
Name of the role that owns the external table.
partitionBies string[]
Specifies any partition columns to evaluate for the external table.
pattern string
Specifies the file names and/or paths on the external stage to match.
refreshOnCreate boolean
Specifies weather to refresh when an external table is created.
schema string
The schema in which to create the external table.
tags ExternalTableTagArgs[]
Definitions of a tag to associate with the resource.
auto_refresh bool
Specifies whether to automatically refresh the external table metadata once, immediately after the external table is created.
aws_sns_topic str
Specifies the aws sns topic for the external table.
columns Sequence[ExternalTableColumnArgs]
Definitions of a column to create in the external table. Minimum one required.
comment str
Specifies a comment for the external table.
copy_grants bool
Specifies to retain the access permissions from the original table when an external table is recreated using the CREATE OR REPLACE TABLE variant
database str
The database in which to create the external table.
file_format str
Specifies the file format for the external table.
location str
Specifies a location for the external table.
name str
Specifies the identifier for the external table; must be unique for the database and schema in which the externalTable is created.
owner str
Name of the role that owns the external table.
partition_bies Sequence[str]
Specifies any partition columns to evaluate for the external table.
pattern str
Specifies the file names and/or paths on the external stage to match.
refresh_on_create bool
Specifies weather to refresh when an external table is created.
schema str
The schema in which to create the external table.
tags Sequence[ExternalTableTagArgs]
Definitions of a tag to associate with the resource.

Supporting Types

ExternalTableColumn

As string
String that specifies the expression for the column. When queried, the column returns results derived from this expression.
Name string
Column name
Type string
Column type, e.g. VARIANT
As string
String that specifies the expression for the column. When queried, the column returns results derived from this expression.
Name string
Column name
Type string
Column type, e.g. VARIANT
as string
String that specifies the expression for the column. When queried, the column returns results derived from this expression.
name string
Column name
type string
Column type, e.g. VARIANT
as_ str
String that specifies the expression for the column. When queried, the column returns results derived from this expression.
name str
Column name
type str
Column type, e.g. VARIANT

ExternalTableTag

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.