Skip to content

Commit

Permalink
Add document for external table (Snowflake-Labs#415)
Browse files Browse the repository at this point in the history
document for external table resource is missing in the main branch.

<!-- summary of changes -->

## Test Plan
<!-- detail ways in which this PR has been tested or needs to be tested -->
* [x] acceptance tests
<!-- add more below if you think they are relevant -->
* [ ] …

## References
<!-- issues documentation links, etc  -->

*
  • Loading branch information
yohei1126 authored and daniepett committed Feb 9, 2022
1 parent 47506e3 commit 355bc52
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/resources/external_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,26 @@ description: |-




## Example Usage

```terraform
resource snowflake_external_table external_table {
database = "db"
schema = "schema"
name = "external_table"
comment = "External table"
column {
name = "id"
type = "int"
}
column {
name = "data"
type = "text"
}
}
```

## Schema

Expand Down Expand Up @@ -45,4 +64,11 @@ Required:
- **name** (String, Required) Column name
- **type** (String, Required) Column type, e.g. VARIANT

## Import

Import is supported using the following syntax:

```shell
# format is database name | schema name | external table name
terraform import snowflake_external_table.example 'dbName|schemaName|externalTableName'
```
2 changes: 2 additions & 0 deletions examples/resources/snowflake_external_table/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# format is database name | schema name | external table name
terraform import snowflake_external_table.example 'dbName|schemaName|externalTableName'
16 changes: 16 additions & 0 deletions examples/resources/snowflake_external_table/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource snowflake_external_table external_table {
database = "db"
schema = "schema"
name = "external_table"
comment = "External table"

column {
name = "id"
type = "int"
}

column {
name = "data"
type = "text"
}
}

0 comments on commit 355bc52

Please sign in to comment.