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

Create resource snowflake_user_grant

Open xlagg5 opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Query like GRANT MONITOR ON USER "SNOWFLAKE" to role "DEVELOPER"; has to be executed to grant privilege's to see query history. Currently this SQL cannot be done by terraform because resource like snowflake_grant_user is not available.

Describe the solution you'd like

I would like to have resource similar to https://registry.terraform.io/providers/chanzuckerberg/snowflake/latest/docs/resources/user_ownership_grant but with option to grant MONITOR privilege's . Because currently only OWNERHSHIP option is possible. Something like snowflake_user_grant where I can specify what type of grants should be added.

Example of code I'd like to implement:

resource "snowflake_user_grant" "airflow" {

  on_user_name = snowflake_user.user.snowflake
  privilege      = "MONITOR"

  roles = [
    snowflake_role.developer.name,
  ]
}

xlagg5 avatar Apr 14 '22 12:04 xlagg5

Any updates when this can be available ?

hragarwal avatar Jul 12 '22 08:07 hragarwal

Right now I've putted the query into our repo to codify it and executed it manually.

xlagg55 avatar Jul 12 '22 13:07 xlagg55

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