UNPKG

@pulumi/gcp

Version:

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

156 lines 7.15 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** 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, Object.assign(Object.assign({}, 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 ? state.createTime : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["diskLimitMib"] = state ? state.diskLimitMib : undefined; resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined; resourceInputs["labels"] = state ? state.labels : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["stateDetails"] = state ? state.stateDetails : undefined; resourceInputs["target"] = state ? state.target : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["volumeName"] = state ? state.volumeName : undefined; } else { const args = argsOrState; if ((!args || args.diskLimitMib === undefined) && !opts.urn) { throw new Error("Missing required property 'diskLimitMib'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } if ((!args || args.volumeName === undefined) && !opts.urn) { throw new Error("Missing required property 'volumeName'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["diskLimitMib"] = args ? args.diskLimitMib : undefined; resourceInputs["labels"] = args ? args.labels : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["target"] = args ? args.target : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["volumeName"] = args ? args.volumeName : undefined; 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