Skip to content

Commit 2e95701

Browse files
committed
fix: update table_id assignment logic for views and materialized views to ensure proper provisioning order
1 parent 27bee96 commit 2e95701

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ resource "google_bigquery_table" "view" {
113113
for_each = local.views
114114
dataset_id = google_bigquery_dataset.main.dataset_id
115115
friendly_name = each.key
116-
table_id = each.key
116+
table_id = contains(keys(local.tables), each.key) ? google_bigquery_table.main[each.key].table_id : each.key
117117
description = each.value["description"]
118118
labels = each.value["labels"]
119119
project = var.project_id
@@ -135,7 +135,7 @@ resource "google_bigquery_table" "materialized_view" {
135135
for_each = local.materialized_views
136136
dataset_id = google_bigquery_dataset.main.dataset_id
137137
friendly_name = each.key
138-
table_id = each.key
138+
table_id = contains(keys(local.tables), each.key) ? google_bigquery_table.main[each.key].table_id : each.key
139139
description = each.value["description"]
140140
labels = each.value["labels"]
141141
clustering = each.value["clustering"]

0 commit comments

Comments
 (0)