@@ -247,6 +247,74 @@ resource "google_bigquery_analytics_hub_listing" "listing" {
247
247
}
248
248
}
249
249
```
250
+ <div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
251
+ <a href =" https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=bigquery_analyticshub_listing_dcr_routine&open_in_editor=main.tf " target =" _blank " >
252
+ <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
253
+ </a >
254
+ </div >
255
+ ## Example Usage - Bigquery Analyticshub Listing Dcr Routine
256
+
257
+
258
+ ``` hcl
259
+ resource "google_bigquery_analytics_hub_data_exchange" "dcr_data_exchange_example" {
260
+ provider = google-beta
261
+ location = "us"
262
+ data_exchange_id = "tf_test_data_exchange"
263
+ display_name = "tf_test_data_exchange"
264
+ description = "Example for listing with routine"
265
+ sharing_environment_config {
266
+ dcr_exchange_config {}
267
+ }
268
+ }
269
+
270
+ resource "google_bigquery_dataset" "listing" {
271
+ provider = google-beta
272
+ dataset_id = "tf_test_dataset"
273
+ friendly_name = "tf_test_dataset"
274
+ description = "Example for listing with routine"
275
+ location = "us"
276
+ }
277
+
278
+ resource "google_bigquery_routine" "listing" {
279
+ provider = google-beta
280
+ dataset_id = google_bigquery_dataset.listing.dataset_id
281
+ routine_id = "tf_test_routine"
282
+ routine_type = "TABLE_VALUED_FUNCTION"
283
+ language = "SQL"
284
+ description = "A DCR routine example."
285
+ definition_body = <<-EOS
286
+ SELECT 1 + value AS value
287
+ EOS
288
+ arguments {
289
+ name = "value"
290
+ argument_kind = "FIXED_TYPE"
291
+ data_type = jsonencode({ "typeKind" : "INT64" })
292
+ }
293
+ return_table_type = jsonencode({
294
+ "columns" : [
295
+ { "name" : "value", "type" : { "typeKind" : "INT64" } },
296
+ ]
297
+ })
298
+ }
299
+
300
+ resource "google_bigquery_analytics_hub_listing" "listing" {
301
+ provider = google-beta
302
+ location = "US"
303
+ data_exchange_id = google_bigquery_analytics_hub_data_exchange.dcr_data_exchange_example.data_exchange_id
304
+ listing_id = "tf_test_listing_routine"
305
+ display_name = "tf_test_listing_routine"
306
+ description = "Example for listing with routine"
307
+ bigquery_dataset {
308
+ dataset = google_bigquery_dataset.listing.id
309
+ selected_resources {
310
+ routine = google_bigquery_routine.listing.id
311
+ }
312
+ }
313
+ restricted_export_config {
314
+ enabled = true
315
+ }
316
+ }
317
+ ```
250
318
251
319
## Argument Reference
252
320
@@ -366,6 +434,10 @@ The following arguments are supported:
366
434
(Optional)
367
435
Format: For table: projects/{projectId}/datasets/{datasetId}/tables/{tableId} Example:"projects/test_project/datasets/test_dataset/tables/test_table"
368
436
437
+ * ` routine ` -
438
+ (Optional, [ Beta] ( https://terraform.io/docs/providers/google/guides/provider_versions.html ) )
439
+ Format: For routine: projects/{projectId}/datasets/{datasetId}/routines/{routineId} Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
440
+
369
441
<a name =" nested_pubsub_topic " ></a >The ` pubsub_topic ` block supports:
370
442
371
443
* ` topic ` -
0 commit comments