Skip to content

Commit 852af53

Browse files
update tutorial about exceptions (#851)
1 parent d54e1e3 commit 852af53

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

mintlify/tutorials/manage-data-masking-with-terraform.mdx

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -365,24 +365,26 @@ resource "bytebase_policy" "masking_exception_policy" {
365365
366366
masking_exception_policy {
367367
exceptions {
368-
reason = "Business requirement"
369-
database = "instances/prod-sample-instance/databases/hr_prod"
370-
table = "employee"
371-
column = "birth_date"
372-
member = "user:[email protected]"
373-
action = "QUERY"
368+
reason = "Business requirement"
369+
database = "instances/prod-sample-instance/databases/hr_prod"
370+
table = "employee"
371+
columns = ["birth_date", "last_name"]
372+
members = ["user:[email protected]"]
373+
actions = ["QUERY", "EXPORT"]
374374
expire_timestamp = "2027-07-30T16:11:49Z"
375-
376375
}
377-
exceptions {
378-
reason = "Export data for analysis"
379-
database = "instances/prod-sample-instance/databases/hr_prod"
380-
table = "employee"
381-
column = "last_name"
382-
member = "user:[email protected]"
383-
action = "EXPORT"
376+
exceptions {
377+
reason = "Export data for analysis"
378+
members = ["user:[email protected]"]
379+
actions = ["EXPORT"]
384380
expire_timestamp = "2027-07-30T16:11:49Z"
385381
}
382+
exceptions {
383+
reason = "Grant query access"
384+
members = ["user:[email protected]"]
385+
actions = ["QUERY"]
386+
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\"]"
387+
}
386388
}
387389
}
388390
```
@@ -398,6 +400,10 @@ Our system uses PostgreSQL to store metadata, where this value is stored as a `t
398400
If you want to apply the exemption to all databases, you can skip the `database`, `table`, and `column` fields.
399401
</Note>
400402

403+
<Note>
404+
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.
405+
</Note>
406+
401407

402408
## Step 7: Apply Final Configuration and Test
403409

0 commit comments

Comments
 (0)