bigquery: add configurable timeouts to google_bigquery_table (#20367)#17492
Open
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Open
bigquery: add configurable timeouts to google_bigquery_table (#20367)#17492jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
jbbqqf wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Conversation
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>
|
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. |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
timeoutsblock togoogle_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_tableis a hand-written resource (lives inmmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go.tmpl)and
grep -n "Timeouts:"againstmainreturns nothing — so theresource 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'sTimeouts: &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:Two small edits:
"time"to the imports.Timeouts: &schema.ResourceTimeout{Create/Update/Delete: schema.DefaultTimeout(20 * time.Minute)}block toResourceBigQueryTable().No expand/flatten or read/update logic changes.
Edge cases tested
timeoutsblock)# omit timeoutsschema.DefaultTimeout(20 * time.Minute)on each operation; the SDK falls back to that when the user doesn't overridetimeouts { update = "60m" }d.Timeout(schema.TimeoutUpdate)semantics)go buildagainst TPGtimeouts { create = "30m" }createoverridden;update/deleteretain defaultsTest protocol
cd mmv1 && go run . --output ... --version ga --no-docsgo build ./google/services/bigquery/...(TPG)go vet ./google/services/bigquery/...(TPG)Timeouts: &schema.ResourceTimeout{...}resource_bigquery_table.goafter regen — confirmedThis 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
google_bigquery_tableshould have configurable timeouts hashicorp/terraform-provider-google#20367dataflow_job:https://github.com/jbbqqf/magic-modules/blob/main/mmv1/third_party/terraform/services/dataflow/resource_dataflow_job.go
https://github.com/jbbqqf/magic-modules/blob/feat/20367-bigquery-table-timeouts/mmv1/third_party/terraform/services/bigquery/resource_bigquery_table.go.tmpl
Release notes
Disclosure
This PR was implemented with assistance from Claude Code. The change is
a straightforward addition of a
Timeoutsblock; the regeneratedprovider compiles and vets cleanly. The author (a human) reviewed the
diff and the regenerated source before opening this PR.