Skip to content

Commit

Permalink
chore!: Release v1 (#3281)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Release v1

- Mark preview features
- Remove deprecated features
- Adjust feature disclaimers
- Update the docs with new examples and references
- Update the provider version in the tracking package

<!-- summary of changes -->

---------

Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 5139b1a commit 82f240e
Show file tree
Hide file tree
Showing 440 changed files with 1,398 additions and 10,418 deletions.
6 changes: 3 additions & 3 deletions CREATING_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ resource "snowflake_grant_privileges_to_account_role" "grant_on_procedure" {
account_role_name = snowflake_account_role.name
on_schema_object {
object_type = "PROCEDURE"
object_name = "\"${snowflake_database.database.name}\".\"${snowflake_schema.schema.name}\".\"${snowflake_procedure.procedure.name}\""
object_name = "\"${snowflake_database.database.name}\".\"${snowflake_schema.schema.name}\".\"${snowflake_procedure_sql.procedure.name}\""
}
}
```
Expand All @@ -202,7 +202,7 @@ resource "snowflake_grant_privileges_to_account_role" "grant_on_procedure" {
account_role_name = snowflake_account_role.name
on_schema_object {
object_type = "PROCEDURE"
object_name = "\"${snowflake_database.database.name}\".\"${snowflake_schema.schema.name}\".\"${snowflake_procedure.procedure.name}\"(NUMBER, VARCHAR)"
object_name = "\"${snowflake_database.database.name}\".\"${snowflake_schema.schema.name}\".\"${snowflake_procedure_sql.procedure.name}\"(NUMBER, VARCHAR)"
}
}
```
Expand All @@ -215,7 +215,7 @@ resource "snowflake_grant_privileges_to_account_role" "grant_on_procedure" {
account_role_name = snowflake_account_role.name
on_schema_object {
object_type = "PROCEDURE"
object_name = snowflake_procedure.procedure_name.fully_qualified_name
object_name = snowflake_procedure_sql.procedure_name.fully_qualified_name
}
}
```
Expand Down
154 changes: 135 additions & 19 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,104 @@ across different versions.
> [!TIP]
> We highly recommend upgrading the versions one by one instead of bulk upgrades.
## 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`
- 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`

If you want to have them enabled, add the feature name to the provider configuration (with `_datasource` or `_resource` suffix), like this:
```terraform
provider "snowflake" {
preview_features_enabled = ["snowflake_current_account_datasource", "snowflake_alert_resource"]
}
```

### Removed deprecated objects
All of the deprecated objects are removed from v1 release. This includes:
- Resources
- `snowflake_database_old` - see [migration guide](#new-feature-new-database-resources)
- `snowflake_role` - see [migration guide](#new-feature-new-snowflake_account_role-resource)
- `snowflake_oauth_integration` - see [migration guide](#new-feature-snowflake_oauth_integration_for_custom_clients-and-snowflake_oauth_integration_for_partner_applications-resources)
- `snowflake_saml_integration` - see [migration guide](#new-feature-snowflake_saml2_integration-resource)
- `snowflake_session_parameter`
- `snowflake_stream` - see [migration guide](#new-feature-snowflake_stream_on_directory_table-and-snowflake_stream_on_view-resource)
- `snowflake_tag_masking_policy_association` - see [migration guide](#snowflake_tag_masking_policy_association-deprecation)
- `snowflake_function`
- `snowflake_procedure`
- `snowflake_unsafe_execute` - see [migration guide](#unsafe_execute-resource-deprecation--new-execute-resource)
- Data sources
- `snowflake_role` - see [migration guide](#snowflake_role-data-source-deprecation)
- `snowflake_roles` - see [migration guide](#new-feature-account-role-data-source)
- Fields in the provider configuration:
- `account` - see [migration guide](#behavior-change-deprecated-fields)
- OAuth related fields - see [migration guide](#structural-change-oauth-api):
- `oauth_access_token`
- `oauth_client_id`
- `oauth_client_secret`
- `oauth_endpoint`
- `oauth_redirect_url`
- `oauth_refresh_token`
- `browser_auth`
- `private_key_path` - see [migration guide](#private_key_path-deprecation)
- `region` - see [migration guide](#remove-redundant-information-region)
- `session_params` - see [migration guide](#rename-session_params--params)
- `username` - see [migration guide](#rename-username--user)
- Fields in `tag` resource:
- `object_name`

Additionally, `JWT` value is no longer available for `authenticator` field in the provider configuration.

## v0.99.0 ➞ v0.100.0

### *(preview feature/deprecation)* Function and procedure resources
Expand Down Expand Up @@ -462,7 +560,8 @@ We have added new fields to match the ones in [the driver](https://pkg.go.dev/gi
To be more consistent with other configuration options, we have decided to add `driver_tracing` to the configuration schema. This value can also be configured by `SNOWFLAKE_DRIVER_TRACING` environmental variable and by `drivertracing` field in the TOML file. The previous `SF_TF_GOSNOWFLAKE_LOG_LEVEL` environmental variable is not supported now, and was removed from the provider.

#### *(behavior change)* deprecated fields
Because of new fields `account_name` and `organization_name`, `account` is now deprecated. It will be removed with the v1 release. Please adjust your configurations from
Because of new fields `account_name` and `organization_name`, `account` is now deprecated. It will be removed with the v1 release.
If you use Terraform configuration file, adjust it from
```terraform
provider "snowflake" {
account = "ORGANIZATION-ACCOUNT"
Expand All @@ -477,6 +576,31 @@ provider "snowflake" {
}
```

If you use TOML configuration file, adjust it from
```toml
[default]
account = "ORGANIZATION-ACCOUNT"
}
```

to
```toml
[default]
organizationname = "ORGANIZATION"
accountname = "ACCOUNT"
}
```

If you use environmental variables, adjust them from
```bash
SNOWFLAKE_ACCOUNT = "ORGANIZATION-ACCOUNT"
```

```bash
SNOWFLAKE_ORGANIZATION_NAME = "ORGANIZATION"
SNOWFLAKE_ACCOUNT_NAME = "ACCOUNT"
```

This change may cause the connection host URL to change. If you get errors like
```
Error: open snowflake connection: Post "https://ORGANIZATION-ACCOUNT.snowflakecomputing.com:443/session/v1/login-request?requestId=[guid]&request_guid=[guid]&roleName=myrole": EOF
Expand Down Expand Up @@ -1270,21 +1394,6 @@ Changes:
- `pattern` was renamed to `like`
- output of SHOW is enclosed in `show_output`, so before, e.g. `roles.0.comment` is now `roles.0.show_output.0.comment`

### *(new feature)* new snowflake_account_role resource

Already existing `snowflake_role` was deprecated in favor of the new `snowflake_account_role`. The old resource got upgraded to
have the same features as the new one. The only difference is the deprecation message on the old resource.

New fields:
- added `show_output` field that holds the response from SHOW ROLES. Remember that the field will be only recomputed if one of the fields (`name` or `comment`) are changed.

### *(breaking change)* refactored snowflake_roles data source

Changes:
- New `in_class` filtering option to filter out roles by class name, e.g. `in_class = "SNOWFLAKE.CORE.BUDGET"`
- `pattern` was renamed to `like`
- output of SHOW is enclosed in `show_output`, so before, e.g. `roles.0.comment` is now `roles.0.show_output.0.comment`

### *(new feature)* snowflake_streamlit resource
Added a new resource for managing streamlits. See reference [docs](https://docs.snowflake.com/en/sql-reference/sql/create-streamlit). In this resource, we decided to split `ROOT_LOCATION` in Snowflake to two fields: `stage` representing stage fully qualified name and `directory_location` containing a path within this stage to root location.

Expand Down Expand Up @@ -1640,6 +1749,11 @@ The `ForceNew` field was removed in favor of in-place Update for `name` paramete
So from now, these objects won't be re-created when the `name` changes, but instead only the name will be updated with `ALTER .. RENAME TO` statements.

## v0.87.0 ➞ v0.88.0

### snowflake_role data source deprecation

Already existing `snowflake_role` was deprecated in favor of the new `snowflake_roles`. You can have a similar behavior like before by specifying `pattern` field. Please adjust your Terraform configurations.

### snowflake_procedure resource changes
#### *(behavior change)* Execute as validation added
From now on, the `snowflake_procedure`'s `execute_as` parameter allows only two values: OWNER and CALLER (case-insensitive). Setting other values earlier resulted in falling back to the Snowflake default (currently OWNER) and creating a permadiff.
Expand Down Expand Up @@ -1842,7 +1956,7 @@ were already available in Golang Snowflake driver. This lead to several attribut
We will focus on the deprecated ones and show you how to adapt your current configuration to the new changes.

#### *(rename)* username ➞ user

Provider field `username` were renamed to `user`. Adjust your provider configuration like below:
```terraform
provider "snowflake" {
# before
Expand All @@ -1854,6 +1968,7 @@ provider "snowflake" {
```

#### *(structural change)* OAuth API
Provider fields regarding Oauth were renamed and nested. Adjust your provider configuration like below:

```terraform
provider "snowflake" {
Expand Down Expand Up @@ -1895,7 +2010,8 @@ provider "snowflake" {
}
```

#### *(todo)* private key path
#### private_key_path deprecation
Provider field `private_key_path` is now deprecated in favor of `private_key` and `file` Terraform function (see [docs](https://developer.hashicorp.com/terraform/language/functions/file)). Adjust your provider configuration like below:

```terraform
provider "snowflake" {
Expand All @@ -1908,7 +2024,7 @@ provider "snowflake" {
```

#### *(rename)* session_params ➞ params

Provider field `session_params` were renamed to `params`. Adjust your provider configuration like below:
```terraform
provider "snowflake" {
# before
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ test: test-client ## run unit and integration tests
go test -v -cover -timeout=45m ./...

test-acceptance: ## run acceptance tests
TF_ACC=1 SF_TF_ACC_TEST_CONFIGURE_CLIENT_ONCE=true TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 go test -run "^TestAcc_" -v -cover -timeout=120m ./...
TF_ACC=1 SF_TF_ACC_TEST_CONFIGURE_CLIENT_ONCE=true TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 SF_TF_ACC_TEST_ENABLE_ALL_PREVIEW_FEATURES=true go test -run "^TestAcc_" -v -cover -timeout=120m ./...

test-integration: ## run SDK integration tests
TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 go test -run "^TestInt_" -v -cover -timeout=60m ./...
Expand All @@ -80,7 +80,7 @@ test-object-renaming: ## runs tests in object_renaming_acceptance_test.go
TEST_SF_TF_ENABLE_OBJECT_RENAMING=1 go test ./pkg/resources/object_renaming_acceptace_test.go -v

test-acceptance-%: ## run acceptance tests for the given resource only, e.g. test-acceptance-Warehouse
TF_ACC=1 TF_LOG=DEBUG SF_TF_ACC_TEST_CONFIGURE_CLIENT_ONCE=true go test -run ^TestAcc_$*_ -v -timeout=20m ./pkg/resources
TF_ACC=1 TF_LOG=DEBUG SF_TF_ACC_TEST_CONFIGURE_CLIENT_ONCE=true SF_TF_ACC_TEST_ENABLE_ALL_PREVIEW_FEATURES=true go test -run ^TestAcc_$*_ -v -timeout=20m ./pkg/resources

build-local: ## build the binary locally
go build -o $(BASE_BINARY_NAME) .
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.

# snowflake_alerts (Data Source)


Expand Down
2 changes: 0 additions & 2 deletions docs/data-sources/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ description: |-
Data source used to get details of filtered connections. Filtering is aligned with the current possibilities for SHOW CONNECTIONS https://docs.snowflake.com/en/sql-reference/sql/show-connections query. The results of SHOW is encapsulated in one output collection connections.
---

!> **V1 release candidate** This data source is a release candidate for the V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the data source if needed. Any errors reported will be resolved with a higher priority. We encourage checking this data source out before the V1 release. Please follow the [migration guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#v0970--v0980) to use it.

# snowflake_connections (Data Source)

Data source used to get details of filtered connections. Filtering is aligned with the current possibilities for [SHOW CONNECTIONS](https://docs.snowflake.com/en/sql-reference/sql/show-connections) query. The results of SHOW is encapsulated in one output collection `connections`.
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/cortex_search_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |-
---

!> **Disclaimer for Cortex Search service** Note that Cortex Search is a Private Preview feature as such, should be used only with non-production data even when using Snowflake's Terraform Provider. Also, note that the Terraform Provider is not covered by Snowflake's support team; the Product and Engineering teams are available for any questions. However, please contact the Cortex Search team for any issues with this object.
!> **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.

# snowflake_cortex_search_services (Data Source)

Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/current_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.

# snowflake_current_account (Data Source)


Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/current_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.

# snowflake_current_role (Data Source)


Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.

# snowflake_database (Data Source)


Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/database_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,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.

# snowflake_database_role (Data Source)


Expand Down
2 changes: 0 additions & 2 deletions docs/data-sources/database_roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ description: |-
Data source used to get details of filtered database roles. Filtering is aligned with the current possibilities for SHOW DATABASE ROLES https://docs.snowflake.com/en/sql-reference/sql/show-database-roles query (like and limit are supported). The results of SHOW is encapsulated in show_output collection.
---

!> **V1 release candidate** This data source was reworked and is a release candidate for the V1. We do not expect significant changes in it before the V1. We will welcome any feedback and adjust the data source if needed. Any errors reported will be resolved with a higher priority. We encourage checking this data source out before the V1 release. Please follow the [migration guide](https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#v0920--v0930) to use it.

# snowflake_database_roles (Data Source)

Data source used to get details of filtered database roles. Filtering is aligned with the current possibilities for [SHOW DATABASE ROLES](https://docs.snowflake.com/en/sql-reference/sql/show-database-roles) query (`like` and `limit` are supported). The results of SHOW is encapsulated in show_output collection.
Expand Down
Loading

0 comments on commit 82f240e

Please sign in to comment.