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

Error Updating Resource Monitor to add/update triggers #2316

Closed
praveenkumarramalingam opened this issue Jan 4, 2024 · 1 comment · Fixed by #2319
Closed

Error Updating Resource Monitor to add/update triggers #2316

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

Comments

@praveenkumarramalingam
Copy link

Terraform CLI and Provider Versions

0.82.0

Terraform Configuration

terraform {
  required_version = "~> 1.6.6"
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "0.82.0"
    }
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

Expected Behavior

I'm trying to update the warehouse monitor's suspend trigger threshold from x to y number

Actual Behavior

Terraform Plan is ok but Terraform apply fails. Reason being the SQL generated for altering is incorrect
Generated SQL
ALTER RESOURCE MONITOR "AR_DEV_FIN_BI_XS_RM" SET TRIGGERS ON 90 PERCENT DO NOTIFY ON 30 PERCENT DO NOTIFY ON 60 PERCENT DO NOTIFY

Rather it is supposed to generate like below one
ALTER RESOURCE MONITOR "AR_DEV_FIN_BI_XS_RM" TRIGGERS ON 90 PERCENT DO NOTIFY ON 30 PERCENT DO NOTIFY ON 60 PERCENT DO NOTIFY

Steps to Reproduce

  1. Create a resource monitor
  2. Try to add or remove new trigger or threshold

How much impact is this issue causing?

High

Logs

No response

Additional Information

Terraform will perform the following actions:

module.warehouses.snowflake_resource_monitor.resource_monitors["AR_DEV_FIN_BI_XS_RM"] will be updated in-place

~ resource "snowflake_resource_monitor" "resource_monitors" {
id = "AR_DEV_FIN_BI_XS_RM"
name = "AR_DEV_FIN_BI_XS_RM"
~ suspend_trigger = 90 -> 95
# (7 unchanged attributes hidden)
}

Plan: 0 to add, 1 to change, 0 to destroy.
module.warehouses.snowflake_resource_monitor.resource_monitors["AR_DEV_FIN_BI_XS_RM"]: Modifying... [id=AR_DEV_FIN_BI_XS_RM]

│ Error: error updating resource monitor AR_DEV_FIN_BI_XS_RM
│ 001003 (42000): SQL compilation error:
│ syntax error line 1 at position 58 unexpected 'ON'.
│ syntax error line 1 at position 72 unexpected 'DO'.
│ syntax error line 1 at position 83 unexpected 'ON'.
│ syntax error line 1 at position 97 unexpected 'DO'.
│ syntax error line 1 at position 107 unexpected 'ON'.
│ syntax error line 1 at position 121 unexpected 'DO'.
│ syntax error line 1 at position 131 unexpected 'ON'.
│ syntax error line 1 at position 145 unexpected 'DO'.
│ syntax error line 1 at position 154 unexpected ''.

│ with module.warehouses.snowflake_resource_monitor.resource_monitors["AR_DEV_FIN_BI_XS_RM"],
│ on ..\modules\common\warehouse\resource_monitors.tf line 1, in resource "snowflake_resource_monitor" "resource_monitors":
│ 1: resource "snowflake_resource_monitor" "resource_monitors" {

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

Hey @praveenkumarramalingam. Thanks for reporting the issue.

It looks like an easy-to-fix bug; we will handle it in the next few days.

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
Development

Successfully merging a pull request may close this issue.

2 participants