Skip to content

Commit 7ce7e84

Browse files
arnavdhamBBBmau
authored andcommitted
Adding support for log_linked_dataset_query_user_email attribute for BigQuery Analytics Hub listings. (GoogleCloudPlatform#14225)
1 parent 9ab8b7e commit 7ce7e84

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

mmv1/products/bigqueryanalyticshub/Listing.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ examples:
6767
data_exchange_id: 'dcr_data_exchange'
6868
listing_id: 'dcr_listing'
6969
desc: 'example dcr data exchange'
70+
- name: 'bigquery_analyticshub_listing_log_linked_dataset_query_user'
71+
primary_resource_id: 'listing'
72+
primary_resource_name: 'fmt.Sprintf("tf_test_log_email_de%s", context["random_suffix"]),fmt.Sprintf("tf_test_log_email_listing%s", context["random_suffix"])'
73+
region_override: 'US'
74+
vars:
75+
data_exchange_id: 'tf_test_log_email_de'
76+
listing_id: 'tf_test_log_email_listing'
77+
dataset_id: 'tf_test_log_email_ds'
78+
description: 'Example for log email test'
7079
parameters:
7180
properties:
7281
- name: 'name'
@@ -194,3 +203,8 @@ properties:
194203
type: Boolean
195204
description:
196205
If true, restrict export of query result derived from restricted linked dataset table.
206+
- name: 'logLinkedDatasetQueryUserEmail'
207+
type: Boolean
208+
description:
209+
If true, subscriber email logging is enabled and all queries on the linked dataset will log the email address of the querying user.
210+
immutable: true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
resource "google_bigquery_analytics_hub_data_exchange" "{{$.PrimaryResourceId}}_log_email" {
2+
location = "US"
3+
data_exchange_id = "{{index $.Vars "data_exchange_id"}}"
4+
display_name = "{{index $.Vars "data_exchange_id"}}"
5+
description = "{{index $.Vars "description"}}"
6+
}
7+
8+
resource "google_bigquery_analytics_hub_listing" "{{$.PrimaryResourceId}}" {
9+
location = "US"
10+
data_exchange_id = google_bigquery_analytics_hub_data_exchange.{{$.PrimaryResourceId}}_log_email.data_exchange_id
11+
listing_id = "{{index $.Vars "listing_id"}}"
12+
display_name = "{{index $.Vars "listing_id"}}"
13+
description = "{{index $.Vars "description"}}"
14+
log_linked_dataset_query_user_email = true
15+
16+
bigquery_dataset {
17+
dataset = google_bigquery_dataset.{{$.PrimaryResourceId}}_log_email.id
18+
}
19+
}
20+
21+
resource "google_bigquery_dataset" "{{$.PrimaryResourceId}}_log_email" {
22+
dataset_id = "{{index $.Vars "dataset_id"}}"
23+
friendly_name = "{{index $.Vars "dataset_id"}}"
24+
description = "{{index $.Vars "description"}}"
25+
location = "US"
26+
}

0 commit comments

Comments
 (0)