UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

268 lines (267 loc) • 10.2 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const myProject = new gcp.organizations.Project("my_project", { * name: "tf-test-project", * projectId: "quota", * orgId: "123456789", * deletionPolicy: "DELETE", * }); * const override = new gcp.serviceusage.ConsumerQuotaOverride("override", { * project: myProject.projectId, * service: "servicemanagement.googleapis.com", * metric: std.urlencode({ * input: "servicemanagement.googleapis.com/default_requests", * }).then(invoke => invoke.result), * limit: std.urlencode({ * input: "/min/project", * }).then(invoke => invoke.result), * overrideValue: "95", * force: true, * }); * ``` * ### Region Consumer Quota Override * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const myProject = new gcp.organizations.Project("my_project", { * name: "tf-test-project", * projectId: "quota", * orgId: "123456789", * deletionPolicy: "DELETE", * }); * const override = new gcp.serviceusage.ConsumerQuotaOverride("override", { * dimensions: { * region: "us-central1", * }, * project: myProject.projectId, * service: "compute.googleapis.com", * metric: std.urlencode({ * input: "compute.googleapis.com/n2_cpus", * }).then(invoke => invoke.result), * limit: std.urlencode({ * input: "/project/region", * }).then(invoke => invoke.result), * overrideValue: "8", * force: true, * }); * ``` * ### Consumer Quota Override Custom Dimension * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as std from "@pulumi/std"; * * const myProject = new gcp.organizations.Project("my_project", { * name: "tf-test-project", * projectId: "quota", * orgId: "123456789", * deletionPolicy: "DELETE", * }); * const override = new gcp.serviceusage.ConsumerQuotaOverride("override", { * project: myProject.projectId, * service: "libraryagent.googleapis.com", * metric: std.urlencode({ * input: "libraryagent.googleapis.com/borrows", * }).then(invoke => invoke.result), * limit: std.urlencode({ * input: "/author/project", * }).then(invoke => invoke.result), * overrideValue: "1", * force: true, * dimensions: { * author: "larry", * }, * }); * ``` * * ## 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}} * ``` */ export declare class ConsumerQuotaOverride extends pulumi.CustomResource { /** * Get an existing ConsumerQuotaOverride resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ConsumerQuotaOverrideState, opts?: pulumi.CustomResourceOptions): ConsumerQuotaOverride; /** * Returns true if the given object is an instance of ConsumerQuotaOverride. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ConsumerQuotaOverride; /** * If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. */ readonly dimensions: pulumi.Output<{ [key: string]: string; } | undefined>; /** * 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. */ readonly force: pulumi.Output<boolean | undefined>; /** * 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}`. */ readonly limit: pulumi.Output<string>; /** * The metric that should be limited, e.g. `compute.googleapis.com/cpus`. */ readonly metric: pulumi.Output<string>; /** * The server-generated name of the quota override. */ readonly name: pulumi.Output<string>; /** * The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). */ readonly overrideValue: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * The service that the metrics belong to, e.g. `compute.googleapis.com`. */ readonly service: pulumi.Output<string>; /** * Create a ConsumerQuotaOverride resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ConsumerQuotaOverrideArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ConsumerQuotaOverride resources. */ export interface ConsumerQuotaOverrideState { /** * If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. */ dimensions?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * 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.Input<boolean>; /** * 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.Input<string>; /** * The metric that should be limited, e.g. `compute.googleapis.com/cpus`. */ metric?: pulumi.Input<string>; /** * The server-generated name of the quota override. */ name?: pulumi.Input<string>; /** * The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). */ overrideValue?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The service that the metrics belong to, e.g. `compute.googleapis.com`. */ service?: pulumi.Input<string>; } /** * The set of arguments for constructing a ConsumerQuotaOverride resource. */ export interface ConsumerQuotaOverrideArgs { /** * If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit. */ dimensions?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * 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.Input<boolean>; /** * 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.Input<string>; /** * The metric that should be limited, e.g. `compute.googleapis.com/cpus`. */ metric: pulumi.Input<string>; /** * The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota). */ overrideValue: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The service that the metrics belong to, e.g. `compute.googleapis.com`. */ service: pulumi.Input<string>; }