Skip to content

Commit 0e9fcf0

Browse files
Merge branch 'dev' into listing-data-source
# Conflicts: # MIGRATION_GUIDE.md
2 parents 7c633a5 + 1c31185 commit 0e9fcf0

File tree

95 files changed

+4405
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4405
-587
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Every introduced change should be tested. Depending on the type of the change it
114114
- adding/modifying existing integration tests (e.g. adding missing SDK invocations)
115115
- adding/modifying existing acceptance tests (e.g. fixing the parameter on the resource level)
116116

117+
When writing acceptance tests, use the configuration and assertion generators instead of manually writing config strings. See [this guide](./pkg/acceptance/bettertestspoc/README.md) for more details.
118+
117119
It's best to discuss with us what checks we expect prior to making the change.
118120

119121
### Describe the breaking changes

MIGRATION_GUIDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ This data source focuses on base query commands (SHOW LISTINGS and DESCRIBE LIST
3333

3434
This feature will be marked as a stable feature in future releases. Breaking changes are expected, even without bumping the major version. To use this feature, add `snowflake_listings_datasource` to `preview_features_enabled` field in the provider configuration.
3535

36+
### *(improvement)* New fields in user resources and data sources output fields
37+
We adjusted the `show_output` by adding the missing `has_workload_identity ` field. This concerns `user`, `service_user`, and `legacy_service_user` resources and `users` data source.
38+
3639
## v2.10.x ➞ v2.11.0
3740

3841
### *(new feature)* snowflake_notebook

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test-acceptance: ## run acceptance tests
7373
TF_ACC=1 TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 TEST_SF_TF_REQUIRE_GENERATED_RANDOM_VALUE=1 SF_TF_ACC_TEST_ENABLE_ALL_PREVIEW_FEATURES=true go test --tags=non_account_level_tests -run "^TestAcc_" -v -cover -timeout=150m ./pkg/testacc
7474

7575
test-account-level-features: ## run integration and acceptance test modifying account
76-
TF_ACC=1 TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 TEST_SF_TF_REQUIRE_GENERATED_RANDOM_VALUE=1 SF_TF_ACC_TEST_ENABLE_ALL_PREVIEW_FEATURES=true go test --tags=account_level_tests -run "^(TestAcc_|TestInt_)" -v -cover -timeout=45m ./pkg/testacc ./pkg/sdk/testint
76+
TF_ACC=1 TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 TEST_SF_TF_REQUIRE_GENERATED_RANDOM_VALUE=1 SF_TF_ACC_TEST_ENABLE_ALL_PREVIEW_FEATURES=true go test --tags=account_level_tests -run "^(TestAcc_|TestInt_)" -v -cover -timeout=60m ./pkg/testacc ./pkg/sdk/testint
7777

7878
test-integration: ## run SDK integration tests
7979
TEST_SF_TF_REQUIRE_TEST_OBJECT_SUFFIX=1 TEST_SF_TF_REQUIRE_GENERATED_RANDOM_VALUE=1 go test --tags=non_account_level_tests -run "^TestInt_" -v -cover -timeout=60m ./pkg/sdk/testint

docs/data-sources/users.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ Read-Only:
150150
- `ext_authn_uid` (String)
151151
- `first_name` (String)
152152
- `has_mfa` (Boolean)
153+
- `has_workload_identity` (Boolean)
153154
- `last_name` (String)
154155
- `login_name` (String)
155156
- `middle_name` (String)
@@ -951,6 +952,7 @@ Read-Only:
951952
- `has_mfa` (Boolean)
952953
- `has_password` (Boolean)
953954
- `has_rsa_public_key` (Boolean)
955+
- `has_workload_identity` (Boolean)
954956
- `last_name` (String)
955957
- `last_success_login` (String)
956958
- `locked_until_time` (String)

docs/guides/performance_benchmarks.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ We can observe that in some scenarios, we have 2x-4x improvement. However, for t
131131

132132
## Terraform CLI version
133133

134-
In Terraform 1.10.0 ([release notes](https://github.com/hashicorp/terraform/releases/tag/v1.10.0)), the performance of the state processing has been improved (see [PR](https://github.com/hashicorp/terraform/pull/35558)), namely internal encoding and decoding of big graphs. If the planning stage takes a long time, even before the provider sends a request to Snowflake, consider upgrading to at least this version.
134+
HashiCorp released two performance improvements between Terraform ~1.8 and ~1.13:
135+
* [core: move change encoding outside of core](https://github.com/hashicorp/terraform/pull/35558) - This improvement in Terraform 1.10.0 ([release notes](https://github.com/hashicorp/terraform/releases/tag/v1.10.0)) enhances the performance of state processing, namely internal encoding and decoding of big graphs.
136+
* [reduce instance change lookups in GetResource](https://github.com/hashicorp/terraform/pull/37154) - This improvement in Terraform 1.13.0 ([release notes](https://github.com/hashicorp/terraform/releases/tag/v1.13.0)) improves resource instance lookups during operations.
137+
138+
If the planning stage takes a long time, even before the provider sends a request to Snowflake, consider upgrading to at least version 1.13.0. These improvements may significantly benefit your performance, especially when working with large workloads.
135139

136140
## Suggestions for users
137141

docs/resources/legacy_service_user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ Read-Only:
10111011
- `has_mfa` (Boolean)
10121012
- `has_password` (Boolean)
10131013
- `has_rsa_public_key` (Boolean)
1014+
- `has_workload_identity` (Boolean)
10141015
- `last_name` (String)
10151016
- `last_success_login` (String)
10161017
- `locked_until_time` (String)

docs/resources/materialized_view.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: |-
77

88
!> **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/snowflakedb/snowflake/latest/docs#schema). Please always refer to the [Getting Help](https://github.com/snowflakedb/terraform-provider-snowflake?tab=readme-ov-file#getting-help) section in our Github repo to best determine how to get help for your questions.
99

10+
~> **Important** The `or_replace` parameter controls whether the provider uses `CREATE OR REPLACE MATERIALIZED VIEW` during create and recreate operations. However, any change to the fields causing recreation will **always trigger delete and create operations** of the materialized view, regardless of the `or_replace` setting.
11+
This means setting `or_replace = true` does **not** enable in-place updates when you modify the `statement` field specifically. Changes to `statement` will cause downtime as the view is dropped and recreated. The `or_replace` parameter is primarily useful to overwrite an existing view during initial resource creation.
12+
This behavior is a known limitation and may be improved in future versions of the provider.
13+
1014
!> **Sensitive values** This resource's `statement` field is not marked as sensitive in the provider. Ensure that no personal data, sensitive data, export-controlled data, or other regulated data is entered as metadata when using the provider. If you use one of these fields, they may be present in logs, so ensure that the provider logs are properly restricted. For more information, see [Sensitive values limitations](../#sensitive-values-limitations) and [Metadata fields in Snowflake](https://docs.snowflake.com/en/sql-reference/metadata).
1115

1216
# snowflake_materialized_view (Resource)
@@ -45,14 +49,14 @@ SQL
4549
- `database` (String) The database in which to create the view. Don't use the | character.
4650
- `name` (String) Specifies the identifier for the view; must be unique for the schema in which the view is created.
4751
- `schema` (String) The schema in which to create the view. Don't use the | character.
48-
- `statement` (String) Specifies the query used to create the view.
52+
- `statement` (String) Specifies the query used to create the view. Changing this value will trigger a drop and recreate of the materialized view.
4953
- `warehouse` (String) The warehouse name.
5054

5155
### Optional
5256

5357
- `comment` (String) Specifies a comment for the view.
5458
- `is_secure` (Boolean) (Default: `false`) Specifies that the view is secure.
55-
- `or_replace` (Boolean) (Default: `false`) Overwrites the View if it exists.
59+
- `or_replace` (Boolean) (Default: `false`) Specifies whether to use CREATE OR REPLACE when creating the materialized view. Note: this does not enable in-place updates when other fields forcing object recreation change; such fields always trigger delete and create operations in Terraform plan.
5660
- `tag` (Block List, Deprecated) Definitions of a tag to associate with the resource. (see [below for nested schema](#nestedblock--tag))
5761
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
5862

docs/resources/resource_monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ resource "snowflake_resource_monitor" "complete" {
6868
- `frequency` (String) The frequency interval at which the credit usage resets to 0. Valid values are (case-insensitive): `MONTHLY` | `DAILY` | `WEEKLY` | `YEARLY` | `NEVER`. If you set a `frequency` for a resource monitor, you must also set `start_timestamp`. If you specify `NEVER` for the frequency, the credit usage for the warehouse does not reset. After removing this field from the config, the previously set value will be preserved on the Snowflake side, not the default value. That's due to Snowflake limitation and the lack of unset functionality for this parameter.
6969
- `notify_triggers` (Set of Number) Specifies a list of percentages of the credit quota. After reaching any of the values the users passed in the notify_users field will be notified (to receive the notification they should have notifications enabled). Values over 100 are supported.
7070
- `notify_users` (Set of String) Specifies the list of users (their identifiers) to receive email notifications on resource monitors. For more information about this resource, see [docs](./user).
71-
- `start_timestamp` (String) The date and time when the resource monitor starts monitoring credit usage for the assigned warehouses. If you set a `start_timestamp` for a resource monitor, you must also set `frequency`. After removing this field from the config, the previously set value will be preserved on the Snowflake side, not the default value. That's due to Snowflake limitation and the lack of unset functionality for this parameter.
71+
- `start_timestamp` (String) The date and time when the resource monitor starts monitoring credit usage for the assigned warehouses. If you set a `start_timestamp` for a resource monitor, you must also set `frequency`. If you specify the special value `IMMEDIATELY`, the current date is used. In this case, the field of this value in `show_output` may be not consistent across different Terraform runs. After removing this field from the config, the previously set value will be preserved on the Snowflake side, not the default value. That's due to Snowflake limitation and the lack of unset functionality for this parameter.
7272
- `suspend_immediate_trigger` (Number) Represents a numeric value specified as a percentage of the credit quota. Values over 100 are supported. After reaching this value, all assigned warehouses immediately cancel any currently running queries or statements. In addition, this action sends a notification to all users who have enabled notifications for themselves.
7373
- `suspend_trigger` (Number) Represents a numeric value specified as a percentage of the credit quota. Values over 100 are supported. After reaching this value, all assigned warehouses while allowing currently running queries to complete will be suspended. No new queries can be executed by the warehouses until the credit quota for the resource monitor is increased. In addition, this action sends a notification to all users who have enabled notifications for themselves.
7474
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

docs/resources/service_user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ Read-Only:
10011001
- `has_mfa` (Boolean)
10021002
- `has_password` (Boolean)
10031003
- `has_rsa_public_key` (Boolean)
1004+
- `has_workload_identity` (Boolean)
10041005
- `last_name` (String)
10051006
- `last_success_login` (String)
10061007
- `locked_until_time` (String)

docs/resources/share.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ description: |-
77

88
!> **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/snowflakedb/snowflake/latest/docs#schema). Please always refer to the [Getting Help](https://github.com/snowflakedb/terraform-provider-snowflake?tab=readme-ov-file#getting-help) section in our Github repo to best determine how to get help for your questions.
99

10+
-> **Note** When adding or updating accounts in the `accounts` field, the provider creates a temporary database as a workaround for a Snowflake race condition. This is because accounts cannot be added to a share until after a database has been granted to the share, but database grants depend on the share existing first.
11+
The provider automatically:
12+
1. Creates a temporary database (named `TEMP_<share_name>_<timestamp>`)
13+
2. Grants `USAGE` and `REFERENCE_USAGE` privileges on the temporary database to the share
14+
3. Adds the specified accounts to the share
15+
4. Revokes the privileges and drops the temporary database
16+
This process is fully automated during the creation.
17+
1018
# snowflake_share (Resource)
1119

1220

0 commit comments

Comments
 (0)