googleServiceUsageConsumerQuotaOverride
A consumer override is applied to the consumer on its own authority to limit its own quota usage. Consumer overrides cannot be used to grant more quota than would be allowed by admin overrides, producer overrides, or the default limit of the service.
\~> Warning: This resource is in beta, and should be used with the terraform-provider-google-beta provider. See Provider Versions for more details on beta resources.
To get more information about ConsumerQuotaOverride, see:
- How-to Guides
- Managing Service Quota
- REST API documentation
Example Usage - Consumer Quota Override
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleProjectMyProject = new google.project.Project(this, "my_project", {
name: "tf-test-project",
org_id: "123456789",
project_id: "quota",
provider: "${google-beta}",
});
new google.serviceUsageConsumerQuotaOverride.ServiceUsageConsumerQuotaOverride(
this,
"override",
{
force: true,
limit: '${urlencode("/min/project")}',
metric: '${urlencode("servicemanagement.googleapis.com/default_requests")}',
override_value: "95",
project: googleProjectMyProject.projectId,
provider: "${google-beta}",
service: "servicemanagement.googleapis.com",
}
);
Example Usage - Region Consumer Quota Override
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleProjectMyProject = new google.project.Project(this, "my_project", {
name: "tf-test-project",
org_id: "123456789",
project_id: "quota",
provider: "${google-beta}",
});
new google.serviceUsageConsumerQuotaOverride.ServiceUsageConsumerQuotaOverride(
this,
"override",
{
dimensions: [
{
region: "us-central1",
},
],
force: true,
limit: '${urlencode("/project/region")}',
metric: '${urlencode("compute.googleapis.com/n2_cpus")}',
override_value: "8",
project: googleProjectMyProject.projectId,
provider: "${google-beta}",
service: "compute.googleapis.com",
}
);
Example Usage - Consumer Quota Override Custom Dimension
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleProjectMyProject = new google.project.Project(this, "my_project", {
name: "tf-test-project",
org_id: "123456789",
project_id: "quota",
provider: "${google-beta}",
});
new google.serviceUsageConsumerQuotaOverride.ServiceUsageConsumerQuotaOverride(
this,
"override",
{
dimensions: [
{
author: "larry",
},
],
force: true,
limit: '${urlencode("/author/project")}',
metric: '${urlencode("libraryagent.googleapis.com/borrows")}',
override_value: "1",
project: googleProjectMyProject.projectId,
provider: "${google-beta}",
service: "libraryagent.googleapis.com",
}
);
Argument Reference
The following arguments are supported:
-
overrideValue
- (Required) The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). -
service
- (Required) The service that the metrics belong to, e.g.computeGoogleapisCom
. -
metric
- (Required) The metric that should be limited, e.g.computeGoogleapisCom/cpus
. -
limit
- (Required) The limit on the metric, e.g./project/region
. \~> Make sure thatlimit
is in a format that doesn't start with1/
or contain curly braces. E.g. use/project/user
instead of1/{project}/{user}
.
-
dimensions
- (Optional) If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. -
force
- (Optional) If the new quota would decrease the existing quota by more than 10%, the request is rejected. Ifforce
istrue
, that safety check is ignored. -
project
- (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
-
id
- an identifier for the resource with formatprojects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
-
name
- The server-generated name of the quota override.
Timeouts
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.
Import
ConsumerQuotaOverride can be imported using any of these accepted formats:
$ terraform import google_service_usage_consumer_quota_override.default projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
$ terraform import google_service_usage_consumer_quota_override.default services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
$ terraform import google_service_usage_consumer_quota_override.default {{service}}/{{metric}}/{{limit}}/{{name}}
User Project Overrides
This resource supports User Project Overrides.