Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update main #3314

Merged
merged 7 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 138 additions & 49 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,146 @@ across different versions.
> [!TIP]
> We highly recommend upgrading the versions one by one instead of bulk upgrades.

## v1.0.0 ➞ v1.0.1

### Fixes in account parameters
As a follow-up of reworked `snowflake_account_parameter`, this version has several improvements regarding handling parameters.

#### Add missing parameters based on the docs and output of SHOW PARAMETERS IN ACCOUNT
Based on [parameters docs](https://docs.snowflake.com/en/sql-reference/parameters) and `SHOW PARAMETERS IN ACCOUNT`, we established a list of supported parameters. New supported or fixed parameters in `snowflake_account_parameter`:
- `ACTIVE_PYTHON_PROFILER`
- `CLIENT_ENABLE_LOG_INFO_STATEMENT_PARAMETERS`
- `CORTEX_ENABLED_CROSS_REGION`
- `CSV_TIMESTAMP_FORMAT`
- `ENABLE_PERSONAL_DATABASE`
- `ENABLE_UNHANDLED_EXCEPTIONS_REPORTING`
- `ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES`
- `HYBRID_TABLE_LOCK_TIMEOUT`
- `JS_TREAT_INTEGER_AS_BIGINT`
- `PREVENT_UNLOAD_TO_INLINE_URL`
- `PREVENT_UNLOAD_TO_INTERNAL_STAGES`
- `PYTHON_PROFILER_MODULES`
- `PYTHON_PROFILER_TARGET_STAGE`
- `STORAGE_SERIALIZATION_POLICY`
- `TASK_AUTO_RETRY_ATTEMPTS`

#### Adjusted validations
Validations for number parameters are now relaxed. This is because a few of the value limits are soft limits in Snowflake, and can be changed externally.
We decided to keep validations for non-negative values. Affected parameters:
- `QUERY_TAG`
- `TWO_DIGIT_CENTURY_START`
- `WEEK_OF_YEAR_POLICY`
- `WEEK_START`
- `USER_TASK_TIMEOUT_MS`

We added non-negative validations for the following parameters:
- `CLIENT_PREFETCH_THREADS`
- `CLIENT_RESULT_CHUNK_SIZE`
- `CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY`
- `HYBRID_TABLE_LOCK_TIMEOUT`
- `JSON_INDENT`
- `STATEMENT_QUEUED_TIMEOUT_IN_SECONDS`
- `STATEMENT_TIMEOUT_IN_SECONDS`
- `TASK_AUTO_RETRY_ATTEMPTS`
- `USER_TASK_MINIMUM_TRIGGER_INTERVAL_IN_SECONDS`

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
Expand Down Expand Up @@ -125,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`
Expand All @@ -141,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.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ provider "snowflake" {
- `passcode_in_password` (Boolean) False by default. Set to true if the MFA passcode is embedded to the configured password. Can also be sourced from the `SNOWFLAKE_PASSCODE_IN_PASSWORD` environment variable.
- `password` (String, Sensitive) Password for user + password auth. Cannot be used with `private_key` and `private_key_passphrase`. Can also be sourced from the `SNOWFLAKE_PASSWORD` environment variable.
- `port` (Number) Specifies a custom port value used by the driver for privatelink connections. Can also be sourced from the `SNOWFLAKE_PORT` environment variable.
- `preview_features_enabled` (Set of String) A list of preview features that are handled by the provider. See [preview features list](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md). Preview features may have breaking changes in future releases, even without raising the major version. This field can not be set with environmental variables. Valid options are: `snowflake_current_account_datasource` | `snowflake_account_authentication_policy_attachment_resource` | `snowflake_account_password_policy_attachment_resource` | `snowflake_alert_resource` | `snowflake_alerts_datasource` | `snowflake_api_integration_resource` | `snowflake_authentication_policy_resource` | `snowflake_cortex_search_service_resource` | `snowflake_cortex_search_services_datasource` | `snowflake_database_datasource` | `snowflake_database_role_datasource` | `snowflake_dynamic_table_resource` | `snowflake_dynamic_tables_datasource` | `snowflake_external_function_resource` | `snowflake_external_functions_datasource` | `snowflake_external_table_resource` | `snowflake_external_tables_datasource` | `snowflake_external_volume_resource` | `snowflake_failover_group_resource` | `snowflake_failover_groups_datasource` | `snowflake_file_format_resource` | `snowflake_file_formats_datasource` | `snowflake_function_java_resource` | `snowflake_function_javascript_resource` | `snowflake_function_python_resource` | `snowflake_function_scala_resource` | `snowflake_function_sql_resource` | `snowflake_managed_account_resource` | `snowflake_materialized_view_resource` | `snowflake_materialized_views_datasource` | `snowflake_network_policy_attachment_resource` | `snowflake_network_rule_resource` | `snowflake_email_notification_integration_resource` | `snowflake_notification_integration_resource` | `snowflake_object_parameter_resource` | `snowflake_password_policy_resource` | `snowflake_pipe_resource` | `snowflake_pipes_datasource` | `snowflake_current_role_datasource` | `snowflake_sequence_resource` | `snowflake_sequences_datasource` | `snowflake_share_resource` | `snowflake_shares_datasource` | `snowflake_parameters_datasource` | `snowflake_procedure_java_resource` | `snowflake_procedure_javascript_resource` | `snowflake_procedure_python_resource` | `snowflake_procedure_scala_resource` | `snowflake_procedure_sql_resource` | `snowflake_stage_resource` | `snowflake_stages_datasource` | `snowflake_storage_integration_resource` | `snowflake_storage_integrations_datasource` | `snowflake_system_generate_scim_access_token_datasource` | `snowflake_system_get_aws_sns_iam_policy_datasource` | `snowflake_system_get_privatelink_config_datasource` | `snowflake_system_get_snowflake_platform_info_datasource` | `snowflake_table_column_masking_policy_application_resource` | `snowflake_table_constraint_resource` | `snowflake_table_resource` | `snowflake_user_authentication_policy_attachment_resource` | `snowflake_user_public_keys_resource` | `snowflake_user_password_policy_attachment_resource`.
- `preview_features_enabled` (Set of String) A list of preview features that are handled by the provider. See [preview features list](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/v1-preparations/LIST_OF_PREVIEW_FEATURES_FOR_V1.md). Preview features may have breaking changes in future releases, even without raising the major version. This field can not be set with environmental variables. Valid options are: `snowflake_current_account_datasource` | `snowflake_account_authentication_policy_attachment_resource` | `snowflake_account_password_policy_attachment_resource` | `snowflake_alert_resource` | `snowflake_alerts_datasource` | `snowflake_api_integration_resource` | `snowflake_authentication_policy_resource` | `snowflake_cortex_search_service_resource` | `snowflake_cortex_search_services_datasource` | `snowflake_database_datasource` | `snowflake_database_role_datasource` | `snowflake_dynamic_table_resource` | `snowflake_dynamic_tables_datasource` | `snowflake_external_function_resource` | `snowflake_external_functions_datasource` | `snowflake_external_table_resource` | `snowflake_external_tables_datasource` | `snowflake_external_volume_resource` | `snowflake_failover_group_resource` | `snowflake_failover_groups_datasource` | `snowflake_file_format_resource` | `snowflake_file_formats_datasource` | `snowflake_function_java_resource` | `snowflake_function_javascript_resource` | `snowflake_function_python_resource` | `snowflake_function_scala_resource` | `snowflake_function_sql_resource` | `snowflake_functions_datasource` | `snowflake_managed_account_resource` | `snowflake_materialized_view_resource` | `snowflake_materialized_views_datasource` | `snowflake_network_policy_attachment_resource` | `snowflake_network_rule_resource` | `snowflake_email_notification_integration_resource` | `snowflake_notification_integration_resource` | `snowflake_object_parameter_resource` | `snowflake_password_policy_resource` | `snowflake_pipe_resource` | `snowflake_pipes_datasource` | `snowflake_current_role_datasource` | `snowflake_sequence_resource` | `snowflake_sequences_datasource` | `snowflake_share_resource` | `snowflake_shares_datasource` | `snowflake_parameters_datasource` | `snowflake_procedure_java_resource` | `snowflake_procedure_javascript_resource` | `snowflake_procedure_python_resource` | `snowflake_procedure_scala_resource` | `snowflake_procedure_sql_resource` | `snowflake_procedures_datasource` | `snowflake_stage_resource` | `snowflake_stages_datasource` | `snowflake_storage_integration_resource` | `snowflake_storage_integrations_datasource` | `snowflake_system_generate_scim_access_token_datasource` | `snowflake_system_get_aws_sns_iam_policy_datasource` | `snowflake_system_get_privatelink_config_datasource` | `snowflake_system_get_snowflake_platform_info_datasource` | `snowflake_table_column_masking_policy_application_resource` | `snowflake_table_constraint_resource` | `snowflake_table_resource` | `snowflake_tables_datasource` | `snowflake_user_authentication_policy_attachment_resource` | `snowflake_user_public_keys_resource` | `snowflake_user_password_policy_attachment_resource`.
- `private_key` (String, Sensitive) Private Key for username+private-key auth. Cannot be used with `password`. Can also be sourced from the `SNOWFLAKE_PRIVATE_KEY` environment variable.
- `private_key_passphrase` (String, Sensitive) Supports the encryption ciphers aes-128-cbc, aes-128-gcm, aes-192-cbc, aes-192-gcm, aes-256-cbc, aes-256-gcm, and des-ede3-cbc. Can also be sourced from the `SNOWFLAKE_PRIVATE_KEY_PASSPHRASE` environment variable.
- `profile` (String) Sets the profile to read from ~/.snowflake/config file. Can also be sourced from the `SNOWFLAKE_PROFILE` environment variable.
Expand Down
Loading
Loading