I get the error below when I automatically create a new GCP project with various resources for example: Redis, SQL, GKE, etc... using Terraform code:
Error: error creating NodePool: googleapi: Error 403:
(1) insufficient regional quota to satisfy request: resource "CPUS": request requires '35.0' and is short '24.0'. project has a quota of '24.0' with '24.0' available. View and manage quotas at https://console.cloud.google.com/iam-admin/quotas?usage=USED&project=<PROJECT_ID>
(2) insufficient regional quota to satisfy request: resource "IN_USE_ADDRESSES": request requires '10.0' and is short '4.0'. project has a quota of '8.0' with '8.0' available. View and manage quotas at https://console.cloud.google.com/iam-admin/quotas?usage=USED&project=<PROJECT_ID>., forbidden
The Terraform code that I was trying to run:
resource "google_project" "my_project" {
provider = google-beta
name = "tf-test-project"
project_id = "quota-123"
org_id = "123456789"
}
resource "google_service_usage_consumer_quota_override" "override" {
provider = google-beta
project = google_project.my_project.project_id
service = "compute.googleapis.com"
metric = "compute.googleapis.com%2Fcpus"
limit = "%2Fproject%2Fregion"
override_value = "95"
force = true
}
The error I get after running the Terraform resource google_service_usage_consumer_quota_override.override
Error: Error creating ConsumerQuotaOverride: googleapi: Error 400: Precise override for limit with quota unit '1/{project}/{region}' on metric 'compute.googleapis.com/cpus' can't be applied in service: compute.googleapis.com.
Details:
[
{
"@type": "type.googleapis.com/google.rpc.PreconditionFailure",
"violations": [
{
"subject": "?error_code=101035\u0026quota_unit=1/%7Bproject%7D/%7Bregion%7D\u0026metric=compute.googleapis.com/cpus\u0026service=compute.googleapis.com",
"type": "googleapis.com"
}
]
}
]
on quota.tf line 1, in resource "google_service_usage_consumer_quota_override" "override":
1: resource "google_service_usage_consumer_quota_override" "override" {
I'd like to increase both GCP resources "CPUS" and "IN_USE_ADDRESSES" quotas using Terraform module for the new GCP project.
Is it possible?
Thanks!
https://www.terraform.io/docs/providers/google/r/service_usage_consumer_quota_override.html