Skip to content

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

Open
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
jbbqqf:feat/20367-bigquery-table-timeouts
Open

bigquery: add configurable timeouts to google_bigquery_table (#20367)#17492
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
jbbqqf:feat/20367-bigquery-table-timeouts

Conversation

@jbbqqf
Copy link
Copy Markdown

@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

Release notes

bigquery: added configurable `timeouts` block (`create`, `update`, `delete`) to `google_bigquery_table`.

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.

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>
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 9, 2026
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot requested a review from c2thorn May 9, 2026 09:16
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

google_bigquery_table should have configurable timeouts

2 participants