UNPKG

@pulumi/gcp

Version:

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

120 lines 5.24 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.SQuotaPreference = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * QuotaPreference represents the preferred quota configuration specified for a project, folder or organization. There is only one QuotaPreference resource for a quota value targeting a unique set of dimensions. * * To get more information about QuotaPreference, see: * * * [API documentation](https://cloud.google.com/docs/quotas/reference/rest/v1/projects.locations.quotaPreferences) * * How-to Guides * * [Cloud Quotas Overview](https://cloud.google.com/docs/quotas/overview) * * ## Example Usage * * ### Cloudquotas Quota Preference Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const preference = new gcp.cloudquota.SQuotaPreference("preference", { * parent: "projects/my-project-name", * name: "compute_googleapis_com-CPUS-per-project_us-east1", * dimensions: { * region: "us-east1", * }, * service: "compute.googleapis.com", * quotaId: "CPUS-per-project-region", * contactEmail: "testuser@gmail.com", * quotaConfig: { * preferredValue: "200", * }, * }); * ``` * * ## Import * * QuotaPreference can be imported using any of these accepted formats: * * * `{{parent}}/locations/global/quotaPreferences/{{name}}` * * When using the `pulumi import` command, QuotaPreference can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:cloudquota/sQuotaPreference:SQuotaPreference default {{parent}}/locations/global/quotaPreferences/{{name}} * ``` */ class SQuotaPreference extends pulumi.CustomResource { /** * Get an existing SQuotaPreference 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, id, state, opts) { return new SQuotaPreference(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of SQuotaPreference. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === SQuotaPreference.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["contactEmail"] = state?.contactEmail; resourceInputs["createTime"] = state?.createTime; resourceInputs["dimensions"] = state?.dimensions; resourceInputs["etag"] = state?.etag; resourceInputs["ignoreSafetyChecks"] = state?.ignoreSafetyChecks; resourceInputs["justification"] = state?.justification; resourceInputs["name"] = state?.name; resourceInputs["parent"] = state?.parent; resourceInputs["quotaConfig"] = state?.quotaConfig; resourceInputs["quotaId"] = state?.quotaId; resourceInputs["reconciling"] = state?.reconciling; resourceInputs["service"] = state?.service; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.quotaConfig === undefined && !opts.urn) { throw new Error("Missing required property 'quotaConfig'"); } resourceInputs["contactEmail"] = args?.contactEmail; resourceInputs["dimensions"] = args?.dimensions; resourceInputs["ignoreSafetyChecks"] = args?.ignoreSafetyChecks; resourceInputs["justification"] = args?.justification; resourceInputs["name"] = args?.name; resourceInputs["parent"] = args?.parent; resourceInputs["quotaConfig"] = args?.quotaConfig; resourceInputs["quotaId"] = args?.quotaId; resourceInputs["service"] = args?.service; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["reconciling"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(SQuotaPreference.__pulumiType, name, resourceInputs, opts); } } exports.SQuotaPreference = SQuotaPreference; /** @internal */ SQuotaPreference.__pulumiType = 'gcp:cloudquota/sQuotaPreference:SQuotaPreference'; //# sourceMappingURL=squotaPreference.js.map