@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
143 lines • 6.3 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SQuotaPreference = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(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 });
}
/** @internal */
static __pulumiType = 'gcp:cloudquota/sQuotaPreference:SQuotaPreference';
/**
* 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;
//# sourceMappingURL=squotaPreference.js.map