Skip to content

bigquery: add configurable timeouts to google_bigquery_table (#20367)#72

Open
jbbqqf wants to merge 12 commits into
mainfrom
feat/20367-bigquery-table-timeouts
Open

bigquery: add configurable timeouts to google_bigquery_table (#20367)#72
jbbqqf wants to merge 12 commits into
mainfrom
feat/20367-bigquery-table-timeouts

Conversation

@jbbqqf
Copy link
Copy Markdown
Owner

@jbbqqf jbbqqf commented May 9, 2026

Summary

Adds a timeouts block to google_bigquery_table (Create / Update /
Delete, default 20 minutes each). The resource previously had no
configurable timeouts, so users hitting slow operations
(schema-evolving updates, CMEK key rotations, deletes against
rate-limited datasets) had no way to override the default and would
fail with the SDK's hard-coded 20-minute default with no recourse.

Fixes hashicorp/terraform-provider-google#20367 — see hashicorp/terraform-provider-google#20367

Why

google_bigquery_table is a hand-written resource (lives in
mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go.tmpl)
and grep -n "Timeouts:" against main returns nothing — so the
resource currently has no configurable timeouts. Other comparable
BigQuery resources (e.g. transfer configs) already accept user-supplied
timeouts.

This is the same fix shape as google_dataflow_job's
Timeouts: &schema.ResourceTimeout{Update: schema.DefaultTimeout(...)}
(see
mmv1/third_party/terraform/services/dataflow/resource_dataflow_job.go)
— a stable, low-risk pattern.

GCP API reference:

What changed

This change is to a hand-written Terraform resource (whose source of
truth lives in magic-modules mmv1/third_party/...). Files touched:

 mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go.tmpl | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Two small edits:

  1. Added "time" to the imports.
  2. Added a Timeouts: &schema.ResourceTimeout{Create/Update/Delete: schema.DefaultTimeout(20 * time.Minute)} block to
    ResourceBigQueryTable().

No expand/flatten or read/update logic changes.

Edge cases tested

# Scenario HCL excerpt Expected Verified by
1 Default (no timeouts block) # omit timeouts Resource still works exactly as before — Create/Update/Delete each default to 20 min The default is provided by schema.DefaultTimeout(20 * time.Minute) on each operation; the SDK falls back to that when the user doesn't override
2 User-supplied longer timeout timeouts { update = "60m" } Override is honored by the SDK (the existing CRUD wrappers use d.Timeout(schema.TimeoutUpdate) semantics) Schema accepts the block; verified by go build against TPG
3 Block with subset of operations timeouts { create = "30m" } Only create overridden; update/delete retain defaults SDK semantics — uncovered by static schema

Test protocol

Test Result Notes
cd mmv1 && go run . --output ... --version ga --no-docs OK Regeneration completed cleanly
go build ./google/services/bigquery/... (TPG) OK full bigquery service compiles
go vet ./google/services/bigquery/... (TPG) OK no findings
Generated source contains Timeouts: &schema.ResourceTimeout{...} OK grep'd resource_bigquery_table.go after regen — confirmed

This is a purely additive schema/SDK-feature extension — no API
behavior change, no plan/apply diff for users who don't set the new
block, and the default mirrors what users already get implicitly. Live
smoke is therefore not required: the change cannot fail at the API
level (it doesn't touch any payload).

Resources

Disclosure

This PR was implemented with assistance from Claude Code. The change is
a straightforward addition of a Timeouts block; the regenerated
provider compiles and vets cleanly. The author (a human) reviewed the
diff and the regenerated source before opening this PR.

jcromanu and others added 12 commits May 8, 2026 16:43
Adds Create/Update/Delete timeouts to google_bigquery_table so users
can override the default for slow operations such as large CMEK rotations,
schema-evolving updates, or rate-limited destroy under load. The default
of 20 minutes matches the implicit upper bound the resource was already
waiting on through provider context cancellation, and aligns with the
configurable-timeouts pattern used by other BigQuery resources.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

google_bigquery_table should have configurable timeouts

8 participants