terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

snowflake_resource_monitor is missing the notify_users attribute

Open jrobison-sb opened this issue 3 years ago • 2 comments

Provider Version

$ terraform --version
Terraform v1.2.0
on darwin_arm64
+ provider registry.terraform.io/aidanmelen/snowsql v0.3.0
+ provider registry.terraform.io/chanzuckerberg/snowflake v0.25.36

Describe the bug

snowflake_resource_monitor is missing the notify_users attribute.

https://docs.snowflake.com/en/sql-reference/sql/create-resource-monitor.html#optional-parameters

Expected behavior

snowflake_resource_monitor has the the notify_users attribute.

Code samples and commands

I would expect the schema to support something like this:

resource "snowflake_resource_monitor" "monitor" {
  notify_users = [
    snowflake_user.foo.name,
  ]
  ...
}

jrobison-sb avatar Jun 21 '22 13:06 jrobison-sb

The feature-request tag might be more appropriate, but this is also something that we would like to use.

preynacc avatar Aug 02 '22 20:08 preynacc

@preynacc and @jrobison-sb - We would also like to use it so Can you Please provide update.

Dinesh-Rupchandani avatar Sep 26 '22 15:09 Dinesh-Rupchandani

I can put a PR in for this in the near future (assuming there is enough interest)

nafarlee avatar Oct 18 '22 14:10 nafarlee

@nafarlee thanks for adding this feature. I get NOTIFY_USERS fields of account-level resource monitors must be null. when try to use notify_users for an account level resource monitor which can be done via Snow SQL.

miditha avatar Nov 20 '22 21:11 miditha

Hmm, I get the same thing in my testing environment, though the Snowflake documentation seems to imply it should work, and the SQL queries being generated are consistent with their recommendations:

CREATE RESOURCE MONITOR "PMFDSRXHCF" NOTIFY_USERS=('A', 'B');
ALTER ACCOUNT SET RESOURCE_MONITOR = "PMFDSRXHCF"; -- NOTIFY_USERS fields of account-level resource monitors must be null.

As I mentioned in that PR, I am far from a Snowflake expert, so I am not sure why this is causing an error (and I especially do not know why it works in Snow SQL). I hope someone else can shed light on this situation. It still works correctly when setting Resource Monitors at the Warehouse level.

On second thought @miditha, it might be better to open a separate bug report, as the scope of this issue was the initial introduction of the feature and should likely be closed.

nafarlee avatar Nov 21 '22 18:11 nafarlee

I am able to use the notify_users meta-argument. I am referring to 0.66.0.

VickyWinner avatar Jul 17 '23 13:07 VickyWinner

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

sfc-gh-asawicki avatar Apr 30 '24 16:04 sfc-gh-asawicki