UNPKG

@pulumi/gcp

Version:

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

156 lines 6.64 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.VolumeQuotaRule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * QuotaRule specifies the maximum capacity a user or group can use within a volume. They can be used for creating default and individual quota rules. * * To get more information about VolumeQuotaRule, see: * * * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.volumes.quotaRules) * * How-to Guides * * [Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/volumes/overview#volume_user_and_group_quotas) * * ## Example Usage * * ### Netapp Volume Quota Rule Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = gcp.compute.getNetwork({ * name: "test-network", * }); * const defaultStoragePool = new gcp.netapp.StoragePool("default", { * name: "test-pool", * location: "us-west2", * serviceLevel: "PREMIUM", * capacityGib: "2048", * network: _default.then(_default => _default.id), * }); * const defaultVolume = new gcp.netapp.Volume("default", { * location: defaultStoragePool.location, * name: "test-volume", * capacityGib: "100", * shareName: "test-volume", * storagePool: defaultStoragePool.name, * protocols: ["NFSV3"], * }); * const testQuotaRule = new gcp.netapp.VolumeQuotaRule("test_quota_rule", { * location: defaultVolume.location, * volumeName: defaultVolume.name, * type: "DEFAULT_USER_QUOTA", * diskLimitMib: 50, * name: "test-volume-quota-rule", * }, { * dependsOn: [defaultVolume], * }); * ``` * * ## Import * * VolumeQuotaRule can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/quotaRules/{{name}}` * * * `{{project}}/{{location}}/{{volume_name}}/{{name}}` * * * `{{location}}/{{volume_name}}/{{name}}` * * When using the `pulumi import` command, VolumeQuotaRule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/quotaRules/{{name}} * ``` * * ```sh * $ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default {{project}}/{{location}}/{{volume_name}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:netapp/volumeQuotaRule:VolumeQuotaRule default {{location}}/{{volume_name}}/{{name}} * ``` */ class VolumeQuotaRule extends pulumi.CustomResource { /** * Get an existing VolumeQuotaRule 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 VolumeQuotaRule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VolumeQuotaRule. 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'] === VolumeQuotaRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createTime"] = state?.createTime; resourceInputs["description"] = state?.description; resourceInputs["diskLimitMib"] = state?.diskLimitMib; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["state"] = state?.state; resourceInputs["stateDetails"] = state?.stateDetails; resourceInputs["target"] = state?.target; resourceInputs["type"] = state?.type; resourceInputs["volumeName"] = state?.volumeName; } else { const args = argsOrState; if (args?.diskLimitMib === undefined && !opts.urn) { throw new Error("Missing required property 'diskLimitMib'"); } if (args?.type === undefined && !opts.urn) { throw new Error("Missing required property 'type'"); } if (args?.volumeName === undefined && !opts.urn) { throw new Error("Missing required property 'volumeName'"); } resourceInputs["description"] = args?.description; resourceInputs["diskLimitMib"] = args?.diskLimitMib; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["project"] = args?.project; resourceInputs["target"] = args?.target; resourceInputs["type"] = args?.type; resourceInputs["volumeName"] = args?.volumeName; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["stateDetails"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(VolumeQuotaRule.__pulumiType, name, resourceInputs, opts); } } exports.VolumeQuotaRule = VolumeQuotaRule; /** @internal */ VolumeQuotaRule.__pulumiType = 'gcp:netapp/volumeQuotaRule:VolumeQuotaRule'; //# sourceMappingURL=volumeQuotaRule.js.map