Skip to content

Commit

Permalink
Add rest of the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-asawicki committed Dec 12, 2024
1 parent f92c6d1 commit dd0fde1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
12 changes: 11 additions & 1 deletion docs/resources/function_java.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ Resource used to manage java function objects. For more information, check [func
## Example Usage

```terraform
resource "snowflake_function_java" "example" {
resource "snowflake_function_java" "w" {
database = "Database"
schema = "Schema"
name = "Name"
arguments {
arg_data_type = "VARCHAR(100)"
arg_name = "x"
}
return_type = "VARCHAR(100)"
handler = "TestFunc.echoVarchar"
function_definition = "\n\tclass TestFunc {\n\t\tpublic static String echoVarchar(String x) {\n\t\t\treturn x;\n\t\t}\n\t}\n"
}
```
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
Expand Down
14 changes: 13 additions & 1 deletion docs/resources/function_javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ Resource used to manage javascript function objects. For more information, check
## Example Usage

```terraform
resource "snowflake_function_javascript" "example" {
# Minimal
resource "snowflake_function_javascript" "minimal" {
database = snowflake_database.test.name
schema = snowflake_schema.test.name
name = "my_javascript_function"
arguments {
arg_data_type = "VARIANT"
arg_name = "x"
}
function_definition = <<EOF
return x;
EOF
return_type = "VARIANT"
}
```
-> **Note** Instead of using fully_qualified_name, you can reference objects managed outside Terraform by constructing a correct ID, consult [identifiers guide](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/guides/identifiers#new-computed-fully-qualified-name-field-in-resources).
Expand Down
12 changes: 11 additions & 1 deletion examples/resources/snowflake_function_java/resource.tf
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
resource "snowflake_function_java" "example" {
resource "snowflake_function_java" "w" {
database = "Database"
schema = "Schema"
name = "Name"
arguments {
arg_data_type = "VARCHAR(100)"
arg_name = "x"
}
return_type = "VARCHAR(100)"
handler = "TestFunc.echoVarchar"
function_definition = "\n\tclass TestFunc {\n\t\tpublic static String echoVarchar(String x) {\n\t\t\treturn x;\n\t\t}\n\t}\n"
}
14 changes: 13 additions & 1 deletion examples/resources/snowflake_function_javascript/resource.tf
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
resource "snowflake_function_javascript" "example" {
# Minimal
resource "snowflake_function_javascript" "minimal" {
database = snowflake_database.test.name
schema = snowflake_schema.test.name
name = "my_javascript_function"
arguments {
arg_data_type = "VARIANT"
arg_name = "x"
}
function_definition = <<EOF
return x;
EOF
return_type = "VARIANT"
}

0 comments on commit dd0fde1

Please sign in to comment.