Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
520 stars 407 forks source link

[Feature]: Support USAGE ON DATASET grants in snowflake_grant_privileges_to_account_role #2894

Open danu165 opened 1 month ago

danu165 commented 1 month ago

Use Cases or Problem Statement

I attempted to use the latest provider to grant usage on a dataset like so:

resource "snowflake_grant_privileges_to_account_role" "model" {
  privileges        = ["USAGE"]
  account_role_name = local.account_role
  on_schema_object {
    object_type = "DATASET"
    object_name = "MY_DB.MY_SCHEMA.MY_DATASET"
  }
}

But got this error:

β”‚ Error: expected [{{} on_schema_object} {{} {{{{} 78}} 0xc000d2a3c0}} {{} object_type}] to be one of ["AGGREGATION POLICY" "ALERT" "AUTHENTICATION POLICY" "DATA METRIC FUNCTION" "DYNAMIC TABLE" "EVENT
TABLE" "EXTERNAL TABLE" "FILE FORMAT" "FUNCTION" "GIT REPOSITORY" "HYBRID TABLE" "IMAGE REPOSITORY" "ICEBERG TABLE" "MASKING POLICY" "MATERIALIZED VIEW" "MODEL" "NETWORK RULE" "PACKAGES POLICY" "PASSWOR
D POLICY" "PIPE" "PROCEDURE" "PROJECTION POLICY" "ROW ACCESS POLICY" "SECRET" "SERVICE" "SESSION POLICY" "SEQUENCE" "STAGE" "STREAM" "TABLE" "TAG" "TASK" "VIEW" "STREAMLIT"], got DATASET

Category

category:grants

Object type(s)

resource:grant_privileges_to_account_role

Proposal

Add DATASET as an option for object_type within resource snowflake_grant_privileges_to_account_role

How much impact is this issue causing?

Low

Additional Information

No response

Would you like to implement a fix?

sfc-gh-jmichalak commented 1 month ago

Duplicates #2807.