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 set Notify Users v0.81.0 #2295

Closed
vgw-rubesh opened this issue Dec 21, 2023 · 1 comment · Fixed by #2298
Closed

Error Updating Resource Monitor to set Notify Users v0.81.0 #2295

vgw-rubesh opened this issue Dec 21, 2023 · 1 comment · Fixed by #2298
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@vgw-rubesh
Copy link

Terraform CLI and Provider Versions

Hi,
I am using the TF version 0.81.0 which has been updated to have the fix for resource monitor update. However this still seems to be an issue as below:

│ Error: error updating resource monitor BIC_DEV_STREAMING_INGEST_RM
│ [resource_monitors.go:309] exactly one of AlterResourceMonitorOptions fields [Set NotifyUsers Triggers] must be set

│ with module.bic_business_unit.module.core_tenant_resources[0].module.ingest_functional_role.module.virtual_warehouse["BIC_DEV_STREAMING_INGEST"].snowflake_resource_monitor.warehouse_rm,
│ on modules/virtual-warehouse/main.tf line 55, in resource "snowflake_resource_monitor" "warehouse_rm":
│ 55: resource "snowflake_resource_monitor" "warehouse_rm" {

Terraform Configuration

resource "snowflake_resource_monitor" "warehouse_rm" {
  name         = "${var.wh_config.wh_name}_RM"
  credit_quota = var.wh_config.credit_quota

  frequency       = "WEEKLY"
  start_timestamp = "immediately"

  notify_triggers           = var.wh_config.notify_triggers
  suspend_trigger           = var.wh_config.suspend_trigger
  suspend_immediate_trigger = var.wh_config.suspend_immediate_trigger

  notify_users = var.assign_rm_notify && var.snowflake_account_name == "main" ? ["SNOWFLAKE_${var.business_unit_prefix}_PROD_ADMIN@VGW.CO"] : []

  warehouses = [snowflake_warehouse.warehouse.name]
  lifecycle {
    ignore_changes = [
      start_timestamp # timestamp is set once and applied from then on
    ]
  }
}

Expected Behavior

The expected behaviour is to have the username set as notify user for the resource monitor but this is failing at Terraform execution time.

Actual Behavior

The pipeline plan is as follows and I am expeting the resource monitor to be updated to have the notify user set as per the plan.

# module.bic_business_unit.module.core_tenant_resources[0].module.ingest_functional_role.module.virtual_warehouse["BIC_DEV_STREAMING_INGEST"].snowflake_resource_monitor.warehouse_rm will be updated in-place ~ resource "snowflake_resource_monitor" "warehouse_rm" { id = "BIC_DEV_STREAMING_INGEST_RM" name = "BIC_DEV_STREAMING_INGEST_RM" + notify_users = [ + "SNOWFLAKE_BIC_PROD_ADMIN@VGW.CO", ] # (8 unchanged attributes hidden) }

Steps to Reproduce

  1. terraform apply
    This is a normal pipeline apply with the code snippet provided above

How much impact is this issue causing?

High

Logs

No response

Additional Information

Thank you for looking into this as this is the second upgrade I am doing to gett his to work. This used to work in prior versions such as 0.67.0 without any issues.

@vgw-rubesh vgw-rubesh added the bug Used to mark issues with provider's incorrect behavior label Dec 21, 2023
@sfc-gh-asawicki
Copy link
Collaborator

Hey @vgw-rubesh. Thanks for creating the issue.

Yes, you are right; the previous fix revealed another problem that appears in certain circumstances. Fix incoming.

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