Snowflake-Labs / terraform-provider-snowflake

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

Resource to apply masking policy on columns in views #2031

Closed Yogesh-BK closed 1 month ago

Yogesh-BK commented 1 year ago

There are resources to create views and masking policies separately, But when I have to use this masking policy to mask a specific column in view, there is no resource available. Basically, we need a resource to automate the below SQL command

ALTER VIEW test_view MODIFY COLUMN test_column
SET MASKING POLICY test_masking_policy USING (test_column, arg1, arg2)

So, the solution is to create a resource to automate the above SQL command.

fredriv commented 1 year ago

This seems similar to the snowflake_table_column_masking_policy_application introduced in https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/1719, only this does not support multiple columns in the USING clause to apply conditional masking policies?

sfc-gh-jcieslak commented 2 months ago

Hey @Yogesh-BK @fredriv 👋 Yesterday, we released a new provider version (v0.95.0) that contains many upgrades to views. Now, it's possible to set masking policy directly in the view resource. Please upgrade using the migration guide and let us know if you observe any issues with the view and newly added fields.

sfc-gh-jmichalak commented 1 month ago

Closing the issue due to inactivity.