Snowflake-Labs / terraform-provider-snowflake

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

[Feature]: Create new resource for granting SNOWFLAKE.ML.CLASSIFICATION roles #2895

Open danu165 opened 1 week ago

danu165 commented 1 week ago

Use Cases or Problem Statement

After creating a classification model, you can grant classification roles like so:

GRANT SNOWFLAKE.ML.CLASSIFICATION ROLE model!mladmin TO ROLE r1;
GRANT SNOWFLAKE.ML.CLASSIFICATION ROLE model!mlconsumer TO ROLE r2;

Source docs: https://docs.snowflake.com/en/user-guide/ml-functions/classification#model-roles-and-usage-privileges

We need these grants supported via terraform as we have terraform manage all of our grants.

Category

category:resource

Object type(s)

No response

Proposal

To follow existing patterns, perhaps create a resource called snowflake_grant_snowflake_ml_classification_role that can grant these roles to parent roles.

How much impact is this issue causing?

Low

Additional Information

No response

Would you like to implement a fix?

sfc-gh-jmichalak commented 1 week ago

Hey @danu165. Thanks for reaching out to us.

This relates to #2896. My comment is similar:

SNOWFLAKE.ML.CLASSIFICATION is still in preview, so it is not part of the V1 scope. For now, you can use https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/unsafe_execute, which can run any SQL statement. We will also welcome a contribution (check https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md).