Skip to content

Commit

Permalink
add dataGovernanceType field to bigquery_routine resource (Google…
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau authored and cmfeng committed Apr 5, 2024
1 parent 6ade2fc commit be5baf5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mmv1/products/bigquery/Routine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ examples:
dataset_id: 'dataset_id'
connection_id: 'connection_id'
routine_id: 'routine_id'
- !ruby/object:Provider::Terraform::Examples
name: 'bigquery_routine_data_governance_type'
primary_resource_id: 'custom_masking_routine'
vars:
dataset_id: 'dataset_id'
routine_id: 'routine_id'
- !ruby/object:Provider::Terraform::Examples
skip_test: true
name: 'bigquery_routine_remote_function'
Expand Down Expand Up @@ -233,6 +239,11 @@ properties:
- :DETERMINISM_LEVEL_UNSPECIFIED
- :DETERMINISTIC
- :NOT_DETERMINISTIC
- !ruby/object:Api::Type::Enum
name: 'dataGovernanceType'
description: If set to DATA_MASKING, the function is validated and made available as a masking function. For more information, see https://cloud.google.com/bigquery/docs/user-defined-functions#custom-mask
values:
- :DATA_MASKING
- !ruby/object:Api::Type::NestedObject
name: 'sparkOptions'
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource "google_bigquery_dataset" "test" {
dataset_id = "tf_test_dataset_id%{random_suffix}"
}

resource "google_bigquery_routine" "custom_masking_routine" {
dataset_id = google_bigquery_dataset.test.dataset_id
routine_id = "custom_masking_routine"
routine_type = "SCALAR_FUNCTION"
language = "SQL"
data_governance_type = "DATA_MASKING"
definition_body = "SAFE.REGEXP_REPLACE(ssn, '[0-9]', 'X')"
arguments {
name = "ssn"
data_type = "{\"typeKind\" : \"STRING\"}"
}
return_type = "{\"typeKind\" : \"STRING\"}"
}

0 comments on commit be5baf5

Please sign in to comment.