@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
94 lines • 4.35 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.DatabaseConnectionPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr database connection pool resource. This can be used to create, read, modify, and delete connection pools for a PostgreSQL managed database on your Vultr account.
*
* ## Example Usage
*
* Create a new database connection pool:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myDatabaseConnectionPool = new vultr.DatabaseConnectionPool("myDatabaseConnectionPool", {
* databaseId: vultr_database.my_database.id,
* database: "defaultdb",
* username: "vultradmin",
* mode: "transaction",
* size: 3,
* });
* ```
*/
class DatabaseConnectionPool extends pulumi.CustomResource {
/**
* Get an existing DatabaseConnectionPool 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 DatabaseConnectionPool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DatabaseConnectionPool. 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'] === DatabaseConnectionPool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["database"] = state ? state.database : undefined;
resourceInputs["databaseId"] = state ? state.databaseId : undefined;
resourceInputs["mode"] = state ? state.mode : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.database === undefined) && !opts.urn) {
throw new Error("Missing required property 'database'");
}
if ((!args || args.databaseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseId'");
}
if ((!args || args.mode === undefined) && !opts.urn) {
throw new Error("Missing required property 'mode'");
}
if ((!args || args.size === undefined) && !opts.urn) {
throw new Error("Missing required property 'size'");
}
if ((!args || args.username === undefined) && !opts.urn) {
throw new Error("Missing required property 'username'");
}
resourceInputs["database"] = args ? args.database : undefined;
resourceInputs["databaseId"] = args ? args.databaseId : undefined;
resourceInputs["mode"] = args ? args.mode : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["username"] = args ? args.username : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DatabaseConnectionPool.__pulumiType, name, resourceInputs, opts);
}
}
exports.DatabaseConnectionPool = DatabaseConnectionPool;
/** @internal */
DatabaseConnectionPool.__pulumiType = 'vultr:index/databaseConnectionPool:DatabaseConnectionPool';
//# sourceMappingURL=databaseConnectionPool.js.map