-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,228 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "snowflake_procedure Resource - terraform-provider-snowflake" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# snowflake_procedure (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "snowflake_schema" "db" { | ||
name = "MYDB" | ||
data_retention_days = 1 | ||
} | ||
resource "snowflake_schema" "schema" { | ||
database = snowflake_database.db.name | ||
name = "MYSCHEMA" | ||
data_retention_days = 1 | ||
} | ||
resource "snowflake_procedure" "proc" { | ||
name = "SAMPLEPROC" | ||
database = snowflake_database.db.name | ||
schema = snowflake_schema.schema.name | ||
arguments { | ||
name = "arg1" | ||
type = "varchar" | ||
} | ||
arguments { | ||
name = "arg2" | ||
type = "DATE" | ||
} | ||
comment = "Procedure with 2 arguments" | ||
return_type = "VARCHAR" | ||
execute_as = "CALLER" | ||
return_behavior = "IMMUTABLE" | ||
null_input_behavior = "RETURNS NULL ON NULL INPUT" | ||
statement = <<EOT | ||
var X=1 | ||
return X | ||
EOT | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- **database** (String) The database in which to create the procedure. Don't use the | character. | ||
- **name** (String) Specifies the identifier for the procedure; does not have to be unique for the schema in which the procedure is created. Don't use the | character. | ||
- **return_type** (String) The return type of the procedure | ||
- **schema** (String) The schema in which to create the procedure. Don't use the | character. | ||
- **statement** (String) Specifies the javascript code used to create the procedure. | ||
|
||
### Optional | ||
|
||
- **arguments** (Block List) List of the arguments for the procedure (see [below for nested schema](#nestedblock--arguments)) | ||
- **comment** (String) Specifies a comment for the procedure. | ||
- **execute_as** (String) Sets execute context - see caller's rights and owner's rights | ||
- **id** (String) The ID of this resource. | ||
- **null_input_behavior** (String) Specifies the behavior of the procedure when called with null inputs. | ||
- **return_behavior** (String) Specifies the behavior of the function when returning results | ||
|
||
<a id="nestedblock--arguments"></a> | ||
### Nested Schema for `arguments` | ||
|
||
Required: | ||
|
||
- **name** (String) The argument name | ||
- **type** (String) The argument type | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# format is database name | schema name | stored procedure name | <list of arg types, separated with '-'> | ||
terraform import snowflake_procedure.example 'dbName|schemaName|procedureName|varchar-varchar-varchar' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# format is database name | schema name | stored procedure name | <list of arg types, separated with '-'> | ||
terraform import snowflake_procedure.example 'dbName|schemaName|procedureName|varchar-varchar-varchar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
resource "snowflake_schema" "db" { | ||
name = "MYDB" | ||
data_retention_days = 1 | ||
} | ||
|
||
resource "snowflake_schema" "schema" { | ||
database = snowflake_database.db.name | ||
name = "MYSCHEMA" | ||
data_retention_days = 1 | ||
} | ||
|
||
resource "snowflake_procedure" "proc" { | ||
name = "SAMPLEPROC" | ||
database = snowflake_database.db.name | ||
schema = snowflake_schema.schema.name | ||
arguments { | ||
name = "arg1" | ||
type = "varchar" | ||
} | ||
arguments { | ||
name = "arg2" | ||
type = "DATE" | ||
} | ||
comment = "Procedure with 2 arguments" | ||
return_type = "VARCHAR" | ||
execute_as = "CALLER" | ||
return_behavior = "IMMUTABLE" | ||
null_input_behavior = "RETURNS NULL ON NULL INPUT" | ||
statement = <<EOT | ||
var X=1 | ||
return X | ||
EOT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.