Skip to content

Commit 48c2651

Browse files
committed
feat(bigquery): Add example for creating an authorized view
1 parent 509628f commit 48c2651

File tree

1 file changed

+4
-5
lines changed
  • bigquery/bigquery_authorized_view_tutorial

1 file changed

+4
-5
lines changed

bigquery/bigquery_authorized_view_tutorial/main.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "google_bigquery_table" "movie_view" {
3333
description = "View to authorize"
3434

3535
view {
36-
query = "SELECT item_id, avg(rating) FROM `chriscar9.movielens.movielens_1m` GROUP BY item_id ORDER BY item_id;"
36+
query = "SELECT item_id, avg(rating) FROM `movie_project.movie_dataset.movie_ratings` GROUP BY item_id ORDER BY item_id;"
3737
use_legacy_sql = false
3838
}
3939
}
@@ -42,8 +42,8 @@ resource "google_bigquery_table" "movie_view" {
4242
# Authorize the view to access the dataset
4343
# that the query data originates from.
4444
resource "google_bigquery_dataset_access" "view_authorization" {
45-
project = "chriscar9"
46-
dataset_id = "movielens"
45+
project = "movie_project"
46+
dataset_id = "movie_dataset"
4747

4848
view {
4949
project_id = google_bigquery_table.movie_view.project
@@ -59,8 +59,7 @@ data "google_iam_policy" "principals_policy" {
5959
binding {
6060
role = "roles/bigquery.dataViewer"
6161
members = [
62-
63-
62+
6463
]
6564
}
6665
}

0 commit comments

Comments
 (0)