@pulumi/vault
Version:
A Pulumi package for creating and managing HashiCorp Vault cloud resources.
93 lines • 3.62 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! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuotaLeaseCount = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manage lease count quotas which enforce the number of leases that can be created.
* A lease count quota can be created at the root level or defined on a namespace or mount by
* specifying a path when creating the quota.
*
* See [Vault's Documentation](https://www.vaultproject.io/docs/enterprise/lease-count-quotas) for more
* information.
*
* **Note** this feature is available only with Vault Enterprise.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
*
* const global = new vault.QuotaLeaseCount("global", {
* name: "global",
* path: "",
* maxLeases: 100,
* });
* ```
*
* ## Import
*
* Lease count quotas can be imported using their names
*
* ```sh
* $ pulumi import vault:index/quotaLeaseCount:QuotaLeaseCount global global
* ```
*/
class QuotaLeaseCount extends pulumi.CustomResource {
/**
* Get an existing QuotaLeaseCount 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 QuotaLeaseCount(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of QuotaLeaseCount. 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'] === QuotaLeaseCount.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["inheritable"] = state?.inheritable;
resourceInputs["maxLeases"] = state?.maxLeases;
resourceInputs["name"] = state?.name;
resourceInputs["namespace"] = state?.namespace;
resourceInputs["path"] = state?.path;
resourceInputs["role"] = state?.role;
}
else {
const args = argsOrState;
if (args?.maxLeases === undefined && !opts.urn) {
throw new Error("Missing required property 'maxLeases'");
}
resourceInputs["inheritable"] = args?.inheritable;
resourceInputs["maxLeases"] = args?.maxLeases;
resourceInputs["name"] = args?.name;
resourceInputs["namespace"] = args?.namespace;
resourceInputs["path"] = args?.path;
resourceInputs["role"] = args?.role;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(QuotaLeaseCount.__pulumiType, name, resourceInputs, opts);
}
}
exports.QuotaLeaseCount = QuotaLeaseCount;
/** @internal */
QuotaLeaseCount.__pulumiType = 'vault:index/quotaLeaseCount:QuotaLeaseCount';
//# sourceMappingURL=quotaLeaseCount.js.map