diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 005f3992ed..1b05e256d8 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -52,61 +52,101 @@ We added non-negative validations for the following parameters: Note that enum parameters are still not validated by the provider - they are only validated in Snowflake. We will handle this during a small rework of the parameters in the future. +### Add missing preview features to config + +Values: +- `snowflake_functions_datasource` +- `snowflake_procedures_datasource` +- `snowflake_tables_datasource` + were missing in the `preview_features_enabled` attribute in the provider's config. They were added. + +References: #3302 + +### functions and procedures docs updated + +Argument names are automatically wrapped in double quotes, so: +- uppercase names should be used or +- argument name should be quoted in the procedure/function definition. + +Updated the docs and the previous migration guide entry. + +References: #3298 + +### python procedure docs updated + +Importing python procedure is currently limited to procedures with snowflake-snowpark-python version explicitly set in Snowflake. Docs were updated. + +References: #3303 + ## v0.100.0 ➞ v1.0.0 ### Preview features flag All of the preview features objects are now disabled by default. This includes: - Resources - - `snowflake_account_password_policy_attachment` - - `snowflake_alert` - - `snowflake_api_integration` - - `snowflake_cortex_search_service` - - `snowflake_dynamic_table` - - `snowflake_external_function` - - `snowflake_external_table` - - `snowflake_external_volume` - - `snowflake_failover_group` - - `snowflake_file_format` - - `snowflake_managed_account` - - `snowflake_materialized_view` - - `snowflake_network_policy_attachment` - - `snowflake_network_rule` - - `snowflake_email_notification_integration` - - `snowflake_notification_integration` - - `snowflake_object_parameter` - - `snowflake_password_policy` - - `snowflake_pipe` - - `snowflake_sequence` - - `snowflake_share` - - `snowflake_stage` - - `snowflake_storage_integration` - - `snowflake_table_column_masking_policy_application` - - `snowflake_table_constraint` - - `snowflake_user_public_keys` - - `snowflake_user_password_policy_attachment` + - `snowflake_account_password_policy_attachment` + - `snowflake_alert` + - `snowflake_api_integration` + - `snowflake_cortex_search_service` + - `snowflake_dynamic_table` + - `snowflake_external_function` + - `snowflake_external_table` + - `snowflake_external_volume` + - `snowflake_failover_group` + - `snowflake_file_format` + - `snowflake_function_java` + - `snowflake_function_javascript` + - `snowflake_function_python` + - `snowflake_function_scala` + - `snowflake_function_sql` + - `snowflake_managed_account` + - `snowflake_materialized_view` + - `snowflake_network_policy_attachment` + - `snowflake_network_rule` + - `snowflake_email_notification_integration` + - `snowflake_notification_integration` + - `snowflake_object_parameter` + - `snowflake_password_policy` + - `snowflake_pipe` + - `snowflake_procedure_java` + - `snowflake_procedure_javascript` + - `snowflake_procedure_python` + - `snowflake_procedure_scala` + - `snowflake_procedure_sql` + - `snowflake_sequence` + - `snowflake_share` + - `snowflake_stage` + - `snowflake_storage_integration` + - `snowflake_table` + - `snowflake_table_column_masking_policy_application` + - `snowflake_table_constraint` + - `snowflake_user_public_keys` + - `snowflake_user_password_policy_attachment` - Data sources - - `snowflake_current_account` - - `snowflake_alerts` - - `snowflake_cortex_search_services` - - `snowflake_database` - - `snowflake_database_role` - - `snowflake_dynamic_tables` - - `snowflake_external_functions` - - `snowflake_external_tables` - - `snowflake_failover_groups` - - `snowflake_file_formats` - - `snowflake_materialized_views` - - `snowflake_pipes` - - `snowflake_current_role` - - `snowflake_sequences` - - `snowflake_shares` - - `snowflake_parameters` - - `snowflake_stages` - - `snowflake_storage_integrations` - - `snowflake_system_generate_scim_access_token` - - `snowflake_system_get_aws_sns_iam_policy` - - `snowflake_system_get_privatelink_config` - - `snowflake_system_get_snowflake_platform_info` + - `snowflake_current_account` + - `snowflake_alerts` + - `snowflake_cortex_search_services` + - `snowflake_database` + - `snowflake_database_role` + - `snowflake_dynamic_tables` + - `snowflake_external_functions` + - `snowflake_external_tables` + - `snowflake_failover_groups` + - `snowflake_file_formats` + - `snowflake_functions` + - `snowflake_materialized_views` + - `snowflake_pipes` + - `snowflake_procedures` + - `snowflake_current_role` + - `snowflake_sequences` + - `snowflake_shares` + - `snowflake_parameters` + - `snowflake_stages` + - `snowflake_storage_integrations` + - `snowflake_system_generate_scim_access_token` + - `snowflake_system_get_aws_sns_iam_policy` + - `snowflake_system_get_privatelink_config` + - `snowflake_system_get_snowflake_platform_info` + - `snowflake_tables` If you want to have them enabled, add the feature name to the provider configuration (with `_datasource` or `_resource` suffix), like this: ```terraform @@ -170,6 +210,8 @@ The new resources are more aligned with current features like: - secrets support - argument default values +**Note**: argument names are now quoted automatically by the provider so remember about this while writing the function definition (argument name should be quoted or uppercase should be used for the argument name). + `snowflake_procedure` is now deprecated in favor of 5 new preview resources: - `snowflake_procedure_java` @@ -186,6 +228,8 @@ The new resources are more aligned with current features like: - secrets support - argument default values +**Note**: argument names are now quoted automatically by the provider so remember about this while writing the procedure definition (argument name should be quoted or uppercase should be used for the argument name). + ### *(new feature)* Account role data source Added a new `snowflake_account_roles` data source for account roles. Now it reflects It's based on `snowflake_roles` data source. `account_roles` field now organizes output of show under `show_output` field. diff --git a/docs/resources/function_java.md b/docs/resources/function_java.md index 5570e2575e..2ad592c726 100644 --- a/docs/resources/function_java.md +++ b/docs/resources/function_java.md @@ -40,7 +40,13 @@ resource "snowflake_function_java" "w" { } 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" + function_definition = < **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). @@ -90,7 +96,7 @@ resource "snowflake_function_java" "w" { Required: - `arg_data_type` (String) The argument type. -- `arg_name` (String) The argument name. +- `arg_name` (String) The argument name. The provider wraps it in double quotes by default, so be aware of that while referencing the argument in the function definition. Optional: diff --git a/docs/resources/function_javascript.md b/docs/resources/function_javascript.md index 9333693081..c587e4b9a9 100644 --- a/docs/resources/function_javascript.md +++ b/docs/resources/function_javascript.md @@ -39,10 +39,14 @@ resource "snowflake_function_javascript" "minimal" { arg_data_type = "VARIANT" arg_name = "x" } - function_definition = < **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). @@ -85,7 +89,7 @@ resource "snowflake_function_javascript" "minimal" { Required: - `arg_data_type` (String) The argument type. -- `arg_name` (String) The argument name. +- `arg_name` (String) The argument name. The provider wraps it in double quotes by default, so be aware of that while referencing the argument in the function definition. Optional: diff --git a/docs/resources/function_python.md b/docs/resources/function_python.md index a2cf487db5..249a4d8ebc 100644 --- a/docs/resources/function_python.md +++ b/docs/resources/function_python.md @@ -42,12 +42,15 @@ resource "snowflake_function_python" "minimal" { arg_data_type = "NUMBER(36, 2)" arg_name = "x" } - function_definition = < **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). @@ -97,7 +100,7 @@ resource "snowflake_function_python" "minimal" { Required: - `arg_data_type` (String) The argument type. -- `arg_name` (String) The argument name. +- `arg_name` (String) The argument name. The provider wraps it in double quotes by default, so be aware of that while referencing the argument in the function definition. Optional: diff --git a/docs/resources/function_scala.md b/docs/resources/function_scala.md index 9a03c90548..9cea381089 100644 --- a/docs/resources/function_scala.md +++ b/docs/resources/function_scala.md @@ -37,16 +37,16 @@ resource "snowflake_function_scala" "minimal" { arg_data_type = "VARCHAR(100)" arg_name = "x" } - function_definition = < **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). @@ -83,7 +89,7 @@ resource "snowflake_procedure_javascript" "basic" { Required: - `arg_data_type` (String) The argument type. -- `arg_name` (String) The argument name. +- `arg_name` (String) The argument name. The provider wraps it in double quotes by default, so be aware of that while referencing the argument in the procedure definition. Optional: diff --git a/docs/resources/procedure_python.md b/docs/resources/procedure_python.md index 76d9495fd4..0ad0eb5505 100644 --- a/docs/resources/procedure_python.md +++ b/docs/resources/procedure_python.md @@ -7,6 +7,8 @@ description: |- !> **Caution: Preview Feature** This feature is considered a preview feature in the provider, regardless of the state of the resource in Snowflake. We do not guarantee its stability. It will be reworked and marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add the relevant feature name to `preview_features_enabled field` in the [provider configuration](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs#schema). Please always refer to the [Getting Help](https://github.com/Snowflake-Labs/terraform-provider-snowflake?tab=readme-ov-file#getting-help) section in our Github repo to best determine how to get help for your questions. +!> **Caution: Import limitation** To import the python procedure, snowflake-snowpark-python version must be explicitly set in Snowflake (i.e. `snowflake-snowpark-python==1.14.0`). You can verify it by running `DESCRIBE PROCEDURE ` and checking the `packages`. Check [#3303](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/3303) for reference. + -> **Note** External changes to `is_secure` and `null_input_behavior` are not currently supported. They will be handled in the following versions of the provider which may still affect this resource. -> **Note** `COPY GRANTS` and `OR REPLACE` are not currently supported. @@ -42,7 +44,13 @@ resource "snowflake_procedure_python" "w" { } return_type = "VARCHAR(100)" handler = "echoVarchar" - procedure_definition = "\ndef echoVarchar(x):\n\tresult = \"\"\n\tfor a in range(5):\n\t\tresult += x\n\treturn result\n" + procedure_definition = < **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). @@ -80,7 +84,7 @@ resource "snowflake_procedure_sql" "w" { Required: - `arg_data_type` (String) The argument type. -- `arg_name` (String) The argument name. +- `arg_name` (String) The argument name. The provider wraps it in double quotes by default, so be aware of that while referencing the argument in the procedure definition. Optional: diff --git a/examples/resources/snowflake_function_java/resource.tf b/examples/resources/snowflake_function_java/resource.tf index a34d6af477..2be224de9c 100644 --- a/examples/resources/snowflake_function_java/resource.tf +++ b/examples/resources/snowflake_function_java/resource.tf @@ -8,5 +8,11 @@ resource "snowflake_function_java" "w" { } 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" + function_definition = < **Caution: Preview Feature** This feature is considered a preview feature in the provider, regardless of the state of the resource in Snowflake. We do not guarantee its stability. It will be reworked and marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add the relevant feature name to `preview_features_enabled field` in the [provider configuration](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs#schema). Please always refer to the [Getting Help](https://github.com/Snowflake-Labs/terraform-provider-snowflake?tab=readme-ov-file#getting-help) section in our Github repo to best determine how to get help for your questions. +!> **Caution: Import limitation** To import the python procedure, snowflake-snowpark-python version must be explicitly set in Snowflake (i.e. `snowflake-snowpark-python==1.14.0`). You can verify it by running `DESCRIBE PROCEDURE ` and checking the `packages`. Check [#3303](https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/3303) for reference. + -> **Note** External changes to `is_secure` and `null_input_behavior` are not currently supported. They will be handled in the following versions of the provider which may still affect this resource. -> **Note** `COPY GRANTS` and `OR REPLACE` are not currently supported. diff --git a/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md b/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md index 93164a2c18..d0c39508a4 100644 --- a/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md +++ b/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md @@ -1,6 +1,6 @@ # List of preview resources and data sources that are available in V1 -[Preview features](../ROADMAP.md#preview-resourcesdata sources) for the V1: +[Preview features](../ROADMAP.md#preview-resourcesdatasources) for the V1: * [snowflake_current_account](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/1.0.0/docs/data-sources/current_account) (data source) * [snowflake_account_password_policy_attachment](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/1.0.0/docs/resources/account_password_policy_attachment)