Skip to content

fix: proper provisioning order for views and materialized views #404

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amirgo1
Copy link

@amirgo1 amirgo1 commented Jul 17, 2025

This PR updates the table_id assignment logic in the google_bigquery_table.view and google_bigquery_table.materialized_view to fix provisioning order issues when views depend on existing base tables.

This helps avoid errors like "Table not found" during apply, which were caused by views being created before their underlying tables:

Error: googleapi: Error 404: Not found: Table <project>:<dataset>.<table> was not found in location <region>, notFound

  with module.<module-name>[0].google_bigquery_table.view["<table>_view"],
  on .terraform/modules/<module-name>/terraform-google-modules/bigquery/google/main.tf line 103, in resource "google_bigquery_table" "view":
 103: resource "google_bigquery_table" "view" {

Thanks to @EliSzBr for the help!

@amirgo1 amirgo1 requested review from ayushmjain, bradmiro, davenportjw, q2w and a team as code owners July 17, 2025 06:25
@amirgo1
Copy link
Author

amirgo1 commented Jul 17, 2025

@ayushmjain would appreciate it if you could have a look 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant