UNPKG

@ediri/vultr

Version:

A Pulumi package for creating and managing Vultr cloud resources.

98 lines 4.56 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.DatabaseQuota = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Vultr database quota resource. This can be used to create, read, and delete quotas for a managed database on your Vultr account. * * ## Example Usage * * Create a new database quota: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vultr from "@ediri/vultr"; * * const myDatabaseQuota = new vultr.DatabaseQuota("myDatabaseQuota", { * databaseId: vultr_database.my_database.id, * clientId: "my_database_quota", * consumerByteRate: 3, * producerByteRate: 2, * requestPercentage: 120, * user: "my_database_user", * }); * ``` */ class DatabaseQuota extends pulumi.CustomResource { /** * Get an existing DatabaseQuota 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 DatabaseQuota(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DatabaseQuota. 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'] === DatabaseQuota.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["clientId"] = state ? state.clientId : undefined; resourceInputs["consumerByteRate"] = state ? state.consumerByteRate : undefined; resourceInputs["databaseId"] = state ? state.databaseId : undefined; resourceInputs["producerByteRate"] = state ? state.producerByteRate : undefined; resourceInputs["requestPercentage"] = state ? state.requestPercentage : undefined; resourceInputs["user"] = state ? state.user : undefined; } else { const args = argsOrState; if ((!args || args.clientId === undefined) && !opts.urn) { throw new Error("Missing required property 'clientId'"); } if ((!args || args.consumerByteRate === undefined) && !opts.urn) { throw new Error("Missing required property 'consumerByteRate'"); } if ((!args || args.databaseId === undefined) && !opts.urn) { throw new Error("Missing required property 'databaseId'"); } if ((!args || args.producerByteRate === undefined) && !opts.urn) { throw new Error("Missing required property 'producerByteRate'"); } if ((!args || args.requestPercentage === undefined) && !opts.urn) { throw new Error("Missing required property 'requestPercentage'"); } if ((!args || args.user === undefined) && !opts.urn) { throw new Error("Missing required property 'user'"); } resourceInputs["clientId"] = args ? args.clientId : undefined; resourceInputs["consumerByteRate"] = args ? args.consumerByteRate : undefined; resourceInputs["databaseId"] = args ? args.databaseId : undefined; resourceInputs["producerByteRate"] = args ? args.producerByteRate : undefined; resourceInputs["requestPercentage"] = args ? args.requestPercentage : undefined; resourceInputs["user"] = args ? args.user : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DatabaseQuota.__pulumiType, name, resourceInputs, opts); } } exports.DatabaseQuota = DatabaseQuota; /** @internal */ DatabaseQuota.__pulumiType = 'vultr:index/databaseQuota:DatabaseQuota'; //# sourceMappingURL=databaseQuota.js.map