-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
google_cloud_quotas_quota_preference fails at apply-time when using ADC #18337
Comments
This looks like a bad configuration on the provider instead of a bug. You could try this and review your credentials and permissions: provider "google" { |
@ggtisc thanks; that was it. My references (4) was apparently subtly broken but your suggestion has let me progress. Now, I get 404s via both ADC and service-account (example taken from my own codebase):
I have verified that both my own account and the SA have
I can successfully apply the code sample I posted at this point. So, I think that the values I'm supplying for To try to reproduce the documentation's sample code, I've tried I guess from that that I'm now exploring https://cloud.google.com/docs/quotas/reference/rest/v1/projects.locations.services.quotaInfos/list with Thanks very much for unblocking me on authn; I'll check in with my TAM for the AI quotaIds. |
Ah! For other readers' benefit; I left |
I tried to reproduce this scenario with the same code, provider version and terraform version. This looks more like troubleshooting. I suggest you verify your account permissions and project configuration. After some tries I had the same successful result without errors. |
Yup; this can be closed. Many thanks. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version & Provider Version(s)
Terraform v1.5.5
on Darwin arm64 (macOS 14.5)
Affected Resource(s)
google_cloud_quotas_quota_preference
Terraform Configuration
Debug Output
https://gist.github.com/petemounce/cf9c10857169c716a9d7466950d230d6
Expected Behavior
The quota preference should have applied cleanly.
Actual Behavior
The quota preference failed at apply-time with
Steps to reproduce
gcloud auth application-default login --project="my-project-name"
gcloud auth application-default set-quota-project "my-project-name"
(perhaps this is redundant)terraform apply
Important Factoids
My ADC has a quota_project_id set:
The apply-time error is not observed when a service-account is used to authenticate.
gcloud --version
is471.0.0
The error persists if I change my terraform to
1.7.5
. (I'm on `1.5.5 because that's the last non-BUSL hashicorp binary)The error persists with terraform
1.8.5
.My user-account has, I believe, sufficient permissions to achieve this.
(💥 ?) Judging by the docs dive (here, then here, and referencing API docs here), plus the request-log in the debug output, the request is missing the I-think-necessary
x-goog-user-project: my-project-name
http header.😢 however, when I set
user_project_override = true
andbilling_project = "my-project-name"
on my provider, I seex-goog-user-project: my-project-name
in the request and I still get the same error.References
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_quotas_quota_preference
Docs link from error: https://cloud.google.com/docs/authentication/troubleshoot-adc#user-creds-client-based
Authenticate via REST API: https://cloud.google.com/docs/authentication/rest#set-billing-project
Seemingly related issue: Creating memcache instance fails: API does not receive quota-project from ADC while polling for existing instance. #15066 (but I didn't understand the action to take :( )
That is; if I define my provider like
Then set
provider = google-for-quota-prefs
on the resource, I get the same error.The text was updated successfully, but these errors were encountered: