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

Masking policy with multiline statement updated every time #1097

Closed kanomaxb closed 1 week ago

kanomaxb commented 2 years ago

Provider Version

0.36

Describe the bug

When masking policy is created using multiline string, like this:

  masking_expression = <<EOF
        case 
            when current_role() in ('ROLE_A') then 
                val 
            when is_role_in_session( 'ROLE_B' ) then 
                'ABC123'
            else
                '******'
        end
    EOF

then it is updated each time. The plan claim that it needs to replace case with the whole expression

Expected behavior

Plan should be empty when no change in masking expression is made.

image

jaloren commented 2 years ago

It looks like when the masking policy is stored in snowflake, it will truncate newlines on the last line of text. If you wrap the multi-line string in a chomp, then terraform shows no difference.

sfc-gh-jmichalak commented 1 month ago

Hi, I'm sorry for the late response. We've released v0.96.0, which includes adjusting and fixing row access policies. Please upgrade with the migration guide.

sfc-gh-jmichalak commented 1 week ago

Closing the issue due to inactivity.