-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: masking policy in v2 sdk (#1777)
* masking policy in v2 sdk * add more tests and docs * add back in region check * linting * linting * linting * linting * fix unit test * update docs * address comments * address comments * remove tag ddl type * Update docs/index.md Co-authored-by: Nathan Gaberel <nathan.gaberel@snowflake.com> * Update templates/index.md.tmpl Co-authored-by: Nathan Gaberel <nathan.gaberel@snowflake.com> * fix PR comments * chore: misc linting errors (#1779) * fix misc linting errors * linting fixes * int tests * cleanup env vars * fix int test for masking policy tag * fix linting errors * remove useless test * skip email notification test * fix int test * fix int test * fix int test * adjust timeout * update docs * disable-if-return * add in temp warehouse * if-return revert * update-docs --------- Co-authored-by: Nathan Gaberel <nathan.gaberel@snowflake.com>
- Loading branch information
1 parent
6feeb9c
commit 6978c42
Showing
118 changed files
with
3,336 additions
and
1,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "snowflake_email_notification_integration Resource - terraform-provider-snowflake" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# snowflake_email_notification_integration (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "snowflake_email_notification_integration" "email_int" { | ||
name = "notification" | ||
comment = "A notification integration." | ||
enabled = true | ||
allowed_recipients = ["john.doe@gmail.com"] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `allowed_recipients` (Set of String) List of email addresses that should receive notifications. | ||
- `enabled` (Boolean) | ||
- `name` (String) | ||
|
||
### Optional | ||
|
||
- `comment` (String) A comment for the email integration. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
terraform import snowflake_email_notification_integration.example name | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,23 @@ | ||
resource "snowflake_masking_policy" "example_masking_policy" { | ||
name = "EXAMPLE_MASKING_POLICY" | ||
resource "snowflake_masking_policy" "test" { | ||
name = "EXAMPLE_MASKING_POLICY" | ||
database = "EXAMPLE_DB" | ||
schema = "EXAMPLE_SCHEMA" | ||
value_data_type = "string" | ||
masking_expression = "case when current_role() in ('ANALYST') then val else sha2(val, 512) end" | ||
return_data_type = "string" | ||
signature { | ||
column { | ||
name = "val" | ||
type = "VARCHAR" | ||
} | ||
} | ||
masking_expression = <<-EOF | ||
case | ||
when current_role() in ('ROLE_A') then | ||
val | ||
when is_role_in_session( 'ROLE_B' ) then | ||
'ABC123' | ||
else | ||
'******' | ||
end | ||
EOF | ||
|
||
return_data_type = "VARCHAR" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.