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

snowflake_warehouse resource does not read warehouse parameters #2318

Closed
joedenniss opened this issue Jan 4, 2024 · 1 comment · Fixed by #2319 or #2305
Closed

snowflake_warehouse resource does not read warehouse parameters #2318

joedenniss opened this issue Jan 4, 2024 · 1 comment · Fixed by #2319 or #2305
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@joedenniss
Copy link

Terraform CLI and Provider Versions

Terraform 1.6.6
Provider 0.65.0+

Terraform Configuration

resource "snowflake_warehouse" "warehouse" {
  name           = "TEST_WAREHOUSE"
  warehouse_size = "XSMALL"

  max_concurrency_level        = 2
  statement_timeout_in_seconds = 60
  statement_queued_timeout_in_seconds = 60
}

Expected Behavior

Existing values of max_concurrency_level, statement_timeout_in_seconds and statement_queued_timeout_in_seconds should be read on plan

Actual Behavior

Values are not read

Steps to Reproduce

  1. terraform apply
  2. Change warehouse parameters
    i) alter warehouse TEST_WAREHOUSE set MAX_CONCURRENCY_LEVEL=4;
    ii) alter warehouse TEST_WAREHOUSE set STATEMENT_TIMEOUT_IN_SECONDS=120;
    iii) alter warehouse TEST_WAREHOUSE set STATEMENT_QUEUED_TIMEOUT_IN_SECONDS=120;
  3. terraform plan

How much impact is this issue causing?

High

Logs

No response

Additional Information

Regression of #745, introduced by #1792

This is particularly dangerous when importing existing warehouses into Terraform, as the provider will obliterate the currently configured values.

@joedenniss joedenniss added the bug Used to mark issues with provider's incorrect behavior label Jan 4, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @joedenniss. Thanks for reporting the issue.

It seems that the warehouse read is omitting these parameters. It is either an easy-to-fix problem or a design decision. I will consult with the team and get back to you. If this is the first option, we will solve it in the next few days.

sfc-gh-asawicki added a commit that referenced this issue Jan 8, 2024
Fix warehouse read and resource monitor empty set:
- Warehouse object parameters were not read, so external changes to them
were not recognized by the resource.
- The resource monitor was always setting Set for alter (even when no
properties were altered), which led to syntax errors on SQL generation.
- The syntax described in the
[docs](https://docs.snowflake.com/en/sql-reference/sql/alter-resource-monitor#syntax)
is not right. Added test to check `ALTER` behavior for just
`NOTIFY_USERS` altered.

Fix #2318
Fix #2316
sfc-gh-jcieslak pushed a commit that referenced this issue Jan 11, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.83.0](v0.82.0...v0.83.0)
(2024-01-11)


### 🎉 **What's new:**

* Add create streamlit privilege to the SDK
([#2303](#2303))
([be01d5f](be01d5f))
* grant privileges to database role resource
([#2306](#2306))
([0311cf8](0311cf8))


### 🐛 **Bug fixes:**

* Add secondary account and fix tests
([#2324](#2324))
([da6ca73](da6ca73))
* external tables issues
([#2334](#2334))
([ae41691](ae41691))
* Fix test because of the date
([#2312](#2312))
([9a9ea33](9a9ea33))
* Fix warehouse read and resource monitor empty set
([#2319](#2319))
([05f96c6](05f96c6)),
closes
[#2318](#2318)
[#2316](#2316)
* goreleaser for mfa token caching
([#2320](#2320))
([4fef709](4fef709))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
2 participants