UNPKG

@pulumi/vault

Version:

A Pulumi package for creating and managing HashiCorp Vault cloud resources.

99 lines 3.99 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.QuotaRateLimit = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manage rate limit quotas which enforce API rate limiting using a token bucket algorithm. * A rate limit 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/concepts/resource-quotas) for more * information. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vault from "@pulumi/vault"; * * const global = new vault.QuotaRateLimit("global", { * name: "global", * path: "", * rate: 100, * }); * ``` * * ## Import * * Rate limit quotas can be imported using their names * * ```sh * $ pulumi import vault:index/quotaRateLimit:QuotaRateLimit global global * ``` */ class QuotaRateLimit extends pulumi.CustomResource { /** * Get an existing QuotaRateLimit 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 QuotaRateLimit(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of QuotaRateLimit. 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'] === QuotaRateLimit.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["blockInterval"] = state?.blockInterval; resourceInputs["groupBy"] = state?.groupBy; resourceInputs["inheritable"] = state?.inheritable; resourceInputs["interval"] = state?.interval; resourceInputs["name"] = state?.name; resourceInputs["namespace"] = state?.namespace; resourceInputs["path"] = state?.path; resourceInputs["rate"] = state?.rate; resourceInputs["role"] = state?.role; resourceInputs["secondaryRate"] = state?.secondaryRate; } else { const args = argsOrState; if (args?.rate === undefined && !opts.urn) { throw new Error("Missing required property 'rate'"); } resourceInputs["blockInterval"] = args?.blockInterval; resourceInputs["groupBy"] = args?.groupBy; resourceInputs["inheritable"] = args?.inheritable; resourceInputs["interval"] = args?.interval; resourceInputs["name"] = args?.name; resourceInputs["namespace"] = args?.namespace; resourceInputs["path"] = args?.path; resourceInputs["rate"] = args?.rate; resourceInputs["role"] = args?.role; resourceInputs["secondaryRate"] = args?.secondaryRate; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(QuotaRateLimit.__pulumiType, name, resourceInputs, opts); } } exports.QuotaRateLimit = QuotaRateLimit; /** @internal */ QuotaRateLimit.__pulumiType = 'vault:index/quotaRateLimit:QuotaRateLimit'; //# sourceMappingURL=quotaRateLimit.js.map