Documentation ¶
Index ¶
- type ConsumerQuotaOverride
- type ConsumerQuotaOverrideArgs
- type ConsumerQuotaOverrideArray
- func (ConsumerQuotaOverrideArray) ElementType() reflect.Type
- func (i ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutput() ConsumerQuotaOverrideArrayOutput
- func (i ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutputWithContext(ctx context.Context) ConsumerQuotaOverrideArrayOutput
- type ConsumerQuotaOverrideArrayInput
- type ConsumerQuotaOverrideArrayOutput
- func (ConsumerQuotaOverrideArrayOutput) ElementType() reflect.Type
- func (o ConsumerQuotaOverrideArrayOutput) Index(i pulumi.IntInput) ConsumerQuotaOverrideOutput
- func (o ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutput() ConsumerQuotaOverrideArrayOutput
- func (o ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutputWithContext(ctx context.Context) ConsumerQuotaOverrideArrayOutput
- type ConsumerQuotaOverrideInput
- type ConsumerQuotaOverrideMap
- type ConsumerQuotaOverrideMapInput
- type ConsumerQuotaOverrideMapOutput
- func (ConsumerQuotaOverrideMapOutput) ElementType() reflect.Type
- func (o ConsumerQuotaOverrideMapOutput) MapIndex(k pulumi.StringInput) ConsumerQuotaOverrideOutput
- func (o ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutput() ConsumerQuotaOverrideMapOutput
- func (o ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutputWithContext(ctx context.Context) ConsumerQuotaOverrideMapOutput
- type ConsumerQuotaOverrideOutput
- func (o ConsumerQuotaOverrideOutput) Dimensions() pulumi.StringMapOutput
- func (ConsumerQuotaOverrideOutput) ElementType() reflect.Type
- func (o ConsumerQuotaOverrideOutput) Force() pulumi.BoolPtrOutput
- func (o ConsumerQuotaOverrideOutput) Limit() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) Metric() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) Name() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) OverrideValue() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) Project() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) Service() pulumi.StringOutput
- func (o ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutput() ConsumerQuotaOverrideOutput
- func (o ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutputWithContext(ctx context.Context) ConsumerQuotaOverrideOutput
- type ConsumerQuotaOverrideState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerQuotaOverride ¶
type ConsumerQuotaOverride struct { pulumi.CustomResourceState // If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. Dimensions pulumi.StringMapOutput `pulumi:"dimensions"` // If the new quota would decrease the existing quota by more than 10%, the request is rejected. // If `force` is `true`, that safety check is ignored. Force pulumi.BoolPtrOutput `pulumi:"force"` // The limit on the metric, e.g. `/project/region`. // > Make sure that `limit` is in a format that doesn't start with `1/` or contain curly braces. // E.g. use `/project/user` instead of `1/{project}/{user}`. // // *** Limit pulumi.StringOutput `pulumi:"limit"` // The metric that should be limited, e.g. `compute.googleapis.com/cpus`. Metric pulumi.StringOutput `pulumi:"metric"` // The server-generated name of the quota override. Name pulumi.StringOutput `pulumi:"name"` // The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). OverrideValue pulumi.StringOutput `pulumi:"overrideValue"` // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. Project pulumi.StringOutput `pulumi:"project"` // The service that the metrics belong to, e.g. `compute.googleapis.com`. Service pulumi.StringOutput `pulumi:"service"` }
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.
To get more information about ConsumerQuotaOverride, see: * How-to Guides
- [Managing Service Quota](https://cloud.google.com/service-usage/docs/manage-quota)
- [REST API documentation](https://cloud.google.com/service-usage/docs/reference/rest/v1beta1/services.consumerQuotaMetrics.limits.consumerOverrides)
## Example Usage
### Consumer Quota Override
```go package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations" "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceusage" "github.com/pulumi/pulumi-std/sdk/go/std" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { myProject, err := organizations.NewProject(ctx, "my_project", &organizations.ProjectArgs{ Name: pulumi.String("tf-test-project"), ProjectId: pulumi.String("quota"), OrgId: pulumi.String("123456789"), DeletionPolicy: pulumi.String("DELETE"), }) if err != nil { return err } invokeUrlencode, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "servicemanagement.googleapis.com/default_requests", }, nil) if err != nil { return err } invokeUrlencode1, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "/min/project", }, nil) if err != nil { return err } _, err = serviceusage.NewConsumerQuotaOverride(ctx, "override", &serviceusage.ConsumerQuotaOverrideArgs{ Project: myProject.ProjectId, Service: pulumi.String("servicemanagement.googleapis.com"), Metric: pulumi.String(invokeUrlencode.Result), Limit: pulumi.String(invokeUrlencode1.Result), OverrideValue: pulumi.String("95"), Force: pulumi.Bool(true), }) if err != nil { return err } return nil }) }
``` ### Region Consumer Quota Override
```go package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations" "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceusage" "github.com/pulumi/pulumi-std/sdk/go/std" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { myProject, err := organizations.NewProject(ctx, "my_project", &organizations.ProjectArgs{ Name: pulumi.String("tf-test-project"), ProjectId: pulumi.String("quota"), OrgId: pulumi.String("123456789"), DeletionPolicy: pulumi.String("DELETE"), }) if err != nil { return err } invokeUrlencode, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "compute.googleapis.com/n2_cpus", }, nil) if err != nil { return err } invokeUrlencode1, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "/project/region", }, nil) if err != nil { return err } _, err = serviceusage.NewConsumerQuotaOverride(ctx, "override", &serviceusage.ConsumerQuotaOverrideArgs{ Dimensions: pulumi.StringMap{ "region": pulumi.String("us-central1"), }, Project: myProject.ProjectId, Service: pulumi.String("compute.googleapis.com"), Metric: pulumi.String(invokeUrlencode.Result), Limit: pulumi.String(invokeUrlencode1.Result), OverrideValue: pulumi.String("8"), Force: pulumi.Bool(true), }) if err != nil { return err } return nil }) }
``` ### Consumer Quota Override Custom Dimension
```go package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations" "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceusage" "github.com/pulumi/pulumi-std/sdk/go/std" "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { myProject, err := organizations.NewProject(ctx, "my_project", &organizations.ProjectArgs{ Name: pulumi.String("tf-test-project"), ProjectId: pulumi.String("quota"), OrgId: pulumi.String("123456789"), DeletionPolicy: pulumi.String("DELETE"), }) if err != nil { return err } invokeUrlencode, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "libraryagent.googleapis.com/borrows", }, nil) if err != nil { return err } invokeUrlencode1, err := std.Urlencode(ctx, &std.UrlencodeArgs{ Input: "/author/project", }, nil) if err != nil { return err } _, err = serviceusage.NewConsumerQuotaOverride(ctx, "override", &serviceusage.ConsumerQuotaOverrideArgs{ Project: myProject.ProjectId, Service: pulumi.String("libraryagent.googleapis.com"), Metric: pulumi.String(invokeUrlencode.Result), Limit: pulumi.String(invokeUrlencode1.Result), OverrideValue: pulumi.String("1"), Force: pulumi.Bool(true), Dimensions: pulumi.StringMap{ "author": pulumi.String("larry"), }, }) if err != nil { return err } return nil }) }
```
## Import
ConsumerQuotaOverride can be imported using any of these accepted formats:
* `projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}`
* `services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}`
* `{{service}}/{{metric}}/{{limit}}/{{name}}`
When using the `pulumi import` command, ConsumerQuotaOverride can be imported using one of the formats above. For example:
```sh $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}} ```
```sh $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}} ```
```sh $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default {{service}}/{{metric}}/{{limit}}/{{name}} ```
func GetConsumerQuotaOverride ¶
func GetConsumerQuotaOverride(ctx *pulumi.Context, name string, id pulumi.IDInput, state *ConsumerQuotaOverrideState, opts ...pulumi.ResourceOption) (*ConsumerQuotaOverride, error)
GetConsumerQuotaOverride gets an existing ConsumerQuotaOverride resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewConsumerQuotaOverride ¶
func NewConsumerQuotaOverride(ctx *pulumi.Context, name string, args *ConsumerQuotaOverrideArgs, opts ...pulumi.ResourceOption) (*ConsumerQuotaOverride, error)
NewConsumerQuotaOverride registers a new resource with the given unique name, arguments, and options.
func (*ConsumerQuotaOverride) ElementType ¶
func (*ConsumerQuotaOverride) ElementType() reflect.Type
func (*ConsumerQuotaOverride) ToConsumerQuotaOverrideOutput ¶
func (i *ConsumerQuotaOverride) ToConsumerQuotaOverrideOutput() ConsumerQuotaOverrideOutput
func (*ConsumerQuotaOverride) ToConsumerQuotaOverrideOutputWithContext ¶
func (i *ConsumerQuotaOverride) ToConsumerQuotaOverrideOutputWithContext(ctx context.Context) ConsumerQuotaOverrideOutput
type ConsumerQuotaOverrideArgs ¶
type ConsumerQuotaOverrideArgs struct { // If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. Dimensions pulumi.StringMapInput // If the new quota would decrease the existing quota by more than 10%, the request is rejected. // If `force` is `true`, that safety check is ignored. Force pulumi.BoolPtrInput // The limit on the metric, e.g. `/project/region`. // > Make sure that `limit` is in a format that doesn't start with `1/` or contain curly braces. // E.g. use `/project/user` instead of `1/{project}/{user}`. // // *** Limit pulumi.StringInput // The metric that should be limited, e.g. `compute.googleapis.com/cpus`. Metric pulumi.StringInput // The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). OverrideValue pulumi.StringInput // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. Project pulumi.StringPtrInput // The service that the metrics belong to, e.g. `compute.googleapis.com`. Service pulumi.StringInput }
The set of arguments for constructing a ConsumerQuotaOverride resource.
func (ConsumerQuotaOverrideArgs) ElementType ¶
func (ConsumerQuotaOverrideArgs) ElementType() reflect.Type
type ConsumerQuotaOverrideArray ¶
type ConsumerQuotaOverrideArray []ConsumerQuotaOverrideInput
func (ConsumerQuotaOverrideArray) ElementType ¶
func (ConsumerQuotaOverrideArray) ElementType() reflect.Type
func (ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutput ¶
func (i ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutput() ConsumerQuotaOverrideArrayOutput
func (ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutputWithContext ¶
func (i ConsumerQuotaOverrideArray) ToConsumerQuotaOverrideArrayOutputWithContext(ctx context.Context) ConsumerQuotaOverrideArrayOutput
type ConsumerQuotaOverrideArrayInput ¶
type ConsumerQuotaOverrideArrayInput interface { pulumi.Input ToConsumerQuotaOverrideArrayOutput() ConsumerQuotaOverrideArrayOutput ToConsumerQuotaOverrideArrayOutputWithContext(context.Context) ConsumerQuotaOverrideArrayOutput }
ConsumerQuotaOverrideArrayInput is an input type that accepts ConsumerQuotaOverrideArray and ConsumerQuotaOverrideArrayOutput values. You can construct a concrete instance of `ConsumerQuotaOverrideArrayInput` via:
ConsumerQuotaOverrideArray{ ConsumerQuotaOverrideArgs{...} }
type ConsumerQuotaOverrideArrayOutput ¶
type ConsumerQuotaOverrideArrayOutput struct{ *pulumi.OutputState }
func (ConsumerQuotaOverrideArrayOutput) ElementType ¶
func (ConsumerQuotaOverrideArrayOutput) ElementType() reflect.Type
func (ConsumerQuotaOverrideArrayOutput) Index ¶
func (o ConsumerQuotaOverrideArrayOutput) Index(i pulumi.IntInput) ConsumerQuotaOverrideOutput
func (ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutput ¶
func (o ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutput() ConsumerQuotaOverrideArrayOutput
func (ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutputWithContext ¶
func (o ConsumerQuotaOverrideArrayOutput) ToConsumerQuotaOverrideArrayOutputWithContext(ctx context.Context) ConsumerQuotaOverrideArrayOutput
type ConsumerQuotaOverrideInput ¶
type ConsumerQuotaOverrideInput interface { pulumi.Input ToConsumerQuotaOverrideOutput() ConsumerQuotaOverrideOutput ToConsumerQuotaOverrideOutputWithContext(ctx context.Context) ConsumerQuotaOverrideOutput }
type ConsumerQuotaOverrideMap ¶
type ConsumerQuotaOverrideMap map[string]ConsumerQuotaOverrideInput
func (ConsumerQuotaOverrideMap) ElementType ¶
func (ConsumerQuotaOverrideMap) ElementType() reflect.Type
func (ConsumerQuotaOverrideMap) ToConsumerQuotaOverrideMapOutput ¶
func (i ConsumerQuotaOverrideMap) ToConsumerQuotaOverrideMapOutput() ConsumerQuotaOverrideMapOutput
func (ConsumerQuotaOverrideMap) ToConsumerQuotaOverrideMapOutputWithContext ¶
func (i ConsumerQuotaOverrideMap) ToConsumerQuotaOverrideMapOutputWithContext(ctx context.Context) ConsumerQuotaOverrideMapOutput
type ConsumerQuotaOverrideMapInput ¶
type ConsumerQuotaOverrideMapInput interface { pulumi.Input ToConsumerQuotaOverrideMapOutput() ConsumerQuotaOverrideMapOutput ToConsumerQuotaOverrideMapOutputWithContext(context.Context) ConsumerQuotaOverrideMapOutput }
ConsumerQuotaOverrideMapInput is an input type that accepts ConsumerQuotaOverrideMap and ConsumerQuotaOverrideMapOutput values. You can construct a concrete instance of `ConsumerQuotaOverrideMapInput` via:
ConsumerQuotaOverrideMap{ "key": ConsumerQuotaOverrideArgs{...} }
type ConsumerQuotaOverrideMapOutput ¶
type ConsumerQuotaOverrideMapOutput struct{ *pulumi.OutputState }
func (ConsumerQuotaOverrideMapOutput) ElementType ¶
func (ConsumerQuotaOverrideMapOutput) ElementType() reflect.Type
func (ConsumerQuotaOverrideMapOutput) MapIndex ¶
func (o ConsumerQuotaOverrideMapOutput) MapIndex(k pulumi.StringInput) ConsumerQuotaOverrideOutput
func (ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutput ¶
func (o ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutput() ConsumerQuotaOverrideMapOutput
func (ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutputWithContext ¶
func (o ConsumerQuotaOverrideMapOutput) ToConsumerQuotaOverrideMapOutputWithContext(ctx context.Context) ConsumerQuotaOverrideMapOutput
type ConsumerQuotaOverrideOutput ¶
type ConsumerQuotaOverrideOutput struct{ *pulumi.OutputState }
func (ConsumerQuotaOverrideOutput) Dimensions ¶
func (o ConsumerQuotaOverrideOutput) Dimensions() pulumi.StringMapOutput
If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit.
func (ConsumerQuotaOverrideOutput) ElementType ¶
func (ConsumerQuotaOverrideOutput) ElementType() reflect.Type
func (ConsumerQuotaOverrideOutput) Force ¶
func (o ConsumerQuotaOverrideOutput) Force() pulumi.BoolPtrOutput
If the new quota would decrease the existing quota by more than 10%, the request is rejected. If `force` is `true`, that safety check is ignored.
func (ConsumerQuotaOverrideOutput) Limit ¶
func (o ConsumerQuotaOverrideOutput) Limit() pulumi.StringOutput
The limit on the metric, e.g. `/project/region`. > Make sure that `limit` is in a format that doesn't start with `1/` or contain curly braces. E.g. use `/project/user` instead of `1/{project}/{user}`.
***
func (ConsumerQuotaOverrideOutput) Metric ¶
func (o ConsumerQuotaOverrideOutput) Metric() pulumi.StringOutput
The metric that should be limited, e.g. `compute.googleapis.com/cpus`.
func (ConsumerQuotaOverrideOutput) Name ¶
func (o ConsumerQuotaOverrideOutput) Name() pulumi.StringOutput
The server-generated name of the quota override.
func (ConsumerQuotaOverrideOutput) OverrideValue ¶
func (o ConsumerQuotaOverrideOutput) OverrideValue() pulumi.StringOutput
The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota).
func (ConsumerQuotaOverrideOutput) Project ¶
func (o ConsumerQuotaOverrideOutput) Project() pulumi.StringOutput
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
func (ConsumerQuotaOverrideOutput) Service ¶
func (o ConsumerQuotaOverrideOutput) Service() pulumi.StringOutput
The service that the metrics belong to, e.g. `compute.googleapis.com`.
func (ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutput ¶
func (o ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutput() ConsumerQuotaOverrideOutput
func (ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutputWithContext ¶
func (o ConsumerQuotaOverrideOutput) ToConsumerQuotaOverrideOutputWithContext(ctx context.Context) ConsumerQuotaOverrideOutput
type ConsumerQuotaOverrideState ¶
type ConsumerQuotaOverrideState struct { // If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. Dimensions pulumi.StringMapInput // If the new quota would decrease the existing quota by more than 10%, the request is rejected. // If `force` is `true`, that safety check is ignored. Force pulumi.BoolPtrInput // The limit on the metric, e.g. `/project/region`. // > Make sure that `limit` is in a format that doesn't start with `1/` or contain curly braces. // E.g. use `/project/user` instead of `1/{project}/{user}`. // // *** Limit pulumi.StringPtrInput // The metric that should be limited, e.g. `compute.googleapis.com/cpus`. Metric pulumi.StringPtrInput // The server-generated name of the quota override. Name pulumi.StringPtrInput // The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). OverrideValue pulumi.StringPtrInput // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. Project pulumi.StringPtrInput // The service that the metrics belong to, e.g. `compute.googleapis.com`. Service pulumi.StringPtrInput }
func (ConsumerQuotaOverrideState) ElementType ¶
func (ConsumerQuotaOverrideState) ElementType() reflect.Type