Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bq analyticshub listing - add support for restrictedExportConfig #9661

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
25 changes: 25 additions & 0 deletions mmv1/products/bigqueryanalyticshub/Listing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ examples:
data_exchange_id: 'my_data_exchange'
listing_id: 'my_listing'
description: 'example data exchange'
- !ruby/object:Provider::Terraform::Examples
name: 'bigquery_analyticshub_listing_restricted'
primary_resource_id: 'listing'
primary_resource_name: "fmt.Sprintf(\"tf_test_my_data_exchange%s\",
context[\"\
random_suffix\"]), fmt.Sprintf(\"tf_test_my_listing%s\",
context[\"random_suffix\"\
])"
region_override: 'US'
vars:
data_exchange_id: 'my_data_exchange'
listing_id: 'my_listing'
description: 'example data exchange'
properties:
- !ruby/object:Api::Type::String
name: name
Expand Down Expand Up @@ -146,3 +159,15 @@ properties:
projects/myproject/datasets/123
required: true
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::NestedObject
name: restrictedExportConfig
description: if set, restricted export configuration will be propagated and enforced on the linked dataset.
melinath marked this conversation as resolved.
Show resolved Hide resolved
properties:
- !ruby/object:Api::Type::Boolean
name: 'enabled'
description:
If true, enable restricted export.
- !ruby/object:Api::Type::Boolean
name: 'restrictQueryResult'
description:
If true, restrict export of query result derived from restricted linked dataset table.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "google_bigquery_analytics_hub_data_exchange" "<%= ctx[:primary_resource_id] %>" {
location = "US"
data_exchange_id = "<%= ctx[:vars]['data_exchange_id'] %>"
display_name = "<%= ctx[:vars]['data_exchange_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
}

resource "google_bigquery_analytics_hub_listing" "<%= ctx[:primary_resource_id] %>" {
location = "US"
data_exchange_id = google_bigquery_analytics_hub_data_exchange.<%= ctx[:primary_resource_id] %>.data_exchange_id
listing_id = "<%= ctx[:vars]['listing_id'] %>"
display_name = "<%= ctx[:vars]['listing_id'] %>"
description = "<%= ctx[:vars]['description'] %>"

bigquery_dataset {
dataset = google_bigquery_dataset.<%= ctx[:primary_resource_id] %>.id
}

restricted_export_config {
enabled = true
restrict_query_result = true
}
}

resource "google_bigquery_dataset" "<%= ctx[:primary_resource_id] %>" {
dataset_id = "<%= ctx[:vars]['listing_id'] %>"
friendly_name = "<%= ctx[:vars]['listing_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
location = "US"
}