Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions mintlify/tutorials/manage-data-masking-with-terraform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -365,24 +365,26 @@ resource "bytebase_policy" "masking_exception_policy" {

masking_exception_policy {
exceptions {
reason = "Business requirement"
database = "instances/prod-sample-instance/databases/hr_prod"
table = "employee"
column = "birth_date"
member = "user:[email protected]"
action = "QUERY"
reason = "Business requirement"
database = "instances/prod-sample-instance/databases/hr_prod"
table = "employee"
columns = ["birth_date", "last_name"]
members = ["user:[email protected]"]
actions = ["QUERY", "EXPORT"]
expire_timestamp = "2027-07-30T16:11:49Z"

}
exceptions {
reason = "Export data for analysis"
database = "instances/prod-sample-instance/databases/hr_prod"
table = "employee"
column = "last_name"
member = "user:[email protected]"
action = "EXPORT"
exceptions {
reason = "Export data for analysis"
members = ["user:[email protected]"]
actions = ["EXPORT"]
expire_timestamp = "2027-07-30T16:11:49Z"
}
exceptions {
reason = "Grant query access"
members = ["user:[email protected]"]
actions = ["QUERY"]
raw_expression = "resource.instance_id == \"prod-sample-instance\" && resource.database_name == \"hr_prod\" && resource.table_name == \"employee\" && resource.column_name in [\"first_name\", \"last_name\", \"gender\"]"
}
}
}
```
Expand All @@ -398,6 +400,10 @@ Our system uses PostgreSQL to store metadata, where this value is stored as a `t
If you want to apply the exemption to all databases, you can skip the `database`, `table`, and `column` fields.
</Note>

<Note>
If you specify `raw_expression`, it defines the exemption condition directly as a CEL expression. When `raw_expression` is used, the other fields (`database`, `schema`, `table`, `columns`, `expire_timestamp`) are ignored.
</Note>


## Step 7: Apply Final Configuration and Test

Expand Down