fix(bigquery): Add retry predicates for BigQuery dataset IAM operations#26429
Draft
ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
Draft
fix(bigquery): Add retry predicates for BigQuery dataset IAM operations#26429ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
ElliotSwart wants to merge 1 commit intohashicorp:mainfrom
Conversation
BigQuery dataset IAM operations (SetResourceIamPolicy) currently do not pass any ErrorRetryPredicates to SendRequest, causing transient errors from service account propagation delays to fail immediately instead of being retried. This adds two existing retry predicates: - IamServiceAccountNotFound: retries 400 errors when a service account referenced in an IAM policy does not yet exist (propagation delay) - IsBigqueryIAMQuotaError: retries 403 errors from BigQuery IAM quota limits This follows the same pattern used by other IAM resource implementations in the provider and addresses errors observed when service accounts and BigQuery dataset IAM policies are created in the same Terraform apply. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This repository is generated by https://github.com/GoogleCloudPlatform/magic-modules. Any changes made directly to this repository will likely be overwritten. If you have further questions, please feel free to ping your reviewer or, internal employees, reach out to one of the engineers. Thank you! |
4 tasks
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
IamServiceAccountNotFoundandIsBigqueryIAMQuotaErrorretry predicates toBigqueryDatasetIamUpdater.SetResourceIamPolicyProblem
SetResourceIamPolicyiniam_bigquery_dataset.gocallsSendRequestwithout anyErrorRetryPredicates. This means:When a
google_service_accountand agoogle_bigquery_dataset_iam_policyreferencing that SA are created in the sameterraform apply, the IAM operation can fail withError 400: Service account <SA> does not existif the SA hasn't fully propagated yet.During bulk BigQuery IAM operations,
Error 403: exceeded rate limitserrors are not retried.Both predicates already exist in
error_retry_predicates.goand are used by other IAM resource implementations, but were not connected to BigQuery dataset IAM operations.Fix
Pass the two existing predicates to
SendRequestinSetResourceIamPolicy:This follows the same pattern used by other IAM implementations in the provider (e.g., Cloud Run IAM).
Test plan
google_bigquery_dataset_iam_policygoogle_bigquery_dataset_iam_bindinggoogle_bigquery_dataset_iam_memberReferences
IamServiceAccountNotFoundpredicate:google/transport/error_retry_predicates.go:470IsBigqueryIAMQuotaErrorpredicate:google/transport/error_retry_predicates.go:304mmv1/third_party/terraform/services/bigquery/iam_bigquery_dataset.go🤖 Generated with Claude Code