@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
137 lines • 7.73 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.DatabaseReplica = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr database replica resource. This can be used to create, read, modify, and delete managed database read replicas on your Vultr account.
*
* ## Example Usage
*
* Create a new database replica:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myDatabaseReplica = new vultr.DatabaseReplica("myDatabaseReplica", {
* databaseId: vultr_database.my_database.id,
* region: "sea",
* label: "my_database_replica_label",
* tag: "test tag",
* });
* ```
*/
class DatabaseReplica extends pulumi.CustomResource {
/**
* Get an existing DatabaseReplica 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 DatabaseReplica(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DatabaseReplica. 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'] === DatabaseReplica.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusterTimeZone"] = state ? state.clusterTimeZone : undefined;
resourceInputs["databaseEngine"] = state ? state.databaseEngine : undefined;
resourceInputs["databaseEngineVersion"] = state ? state.databaseEngineVersion : undefined;
resourceInputs["databaseId"] = state ? state.databaseId : undefined;
resourceInputs["dateCreated"] = state ? state.dateCreated : undefined;
resourceInputs["dbname"] = state ? state.dbname : undefined;
resourceInputs["evictionPolicy"] = state ? state.evictionPolicy : undefined;
resourceInputs["ferretdbCredentials"] = state ? state.ferretdbCredentials : undefined;
resourceInputs["host"] = state ? state.host : undefined;
resourceInputs["label"] = state ? state.label : undefined;
resourceInputs["latestBackup"] = state ? state.latestBackup : undefined;
resourceInputs["maintenanceDow"] = state ? state.maintenanceDow : undefined;
resourceInputs["maintenanceTime"] = state ? state.maintenanceTime : undefined;
resourceInputs["mysqlLongQueryTime"] = state ? state.mysqlLongQueryTime : undefined;
resourceInputs["mysqlRequirePrimaryKey"] = state ? state.mysqlRequirePrimaryKey : undefined;
resourceInputs["mysqlSlowQueryLog"] = state ? state.mysqlSlowQueryLog : undefined;
resourceInputs["mysqlSqlModes"] = state ? state.mysqlSqlModes : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["plan"] = state ? state.plan : undefined;
resourceInputs["planDisk"] = state ? state.planDisk : undefined;
resourceInputs["planRam"] = state ? state.planRam : undefined;
resourceInputs["planReplicas"] = state ? state.planReplicas : undefined;
resourceInputs["planVcpus"] = state ? state.planVcpus : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["publicHost"] = state ? state.publicHost : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tag"] = state ? state.tag : undefined;
resourceInputs["trustedIps"] = state ? state.trustedIps : undefined;
resourceInputs["user"] = state ? state.user : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.databaseId === undefined) && !opts.urn) {
throw new Error("Missing required property 'databaseId'");
}
if ((!args || args.label === undefined) && !opts.urn) {
throw new Error("Missing required property 'label'");
}
if ((!args || args.region === undefined) && !opts.urn) {
throw new Error("Missing required property 'region'");
}
resourceInputs["databaseId"] = args ? args.databaseId : undefined;
resourceInputs["evictionPolicy"] = args ? args.evictionPolicy : undefined;
resourceInputs["ferretdbCredentials"] = args ? args.ferretdbCredentials : undefined;
resourceInputs["label"] = args ? args.label : undefined;
resourceInputs["mysqlLongQueryTime"] = args ? args.mysqlLongQueryTime : undefined;
resourceInputs["mysqlRequirePrimaryKey"] = args ? args.mysqlRequirePrimaryKey : undefined;
resourceInputs["mysqlSlowQueryLog"] = args ? args.mysqlSlowQueryLog : undefined;
resourceInputs["mysqlSqlModes"] = args ? args.mysqlSqlModes : undefined;
resourceInputs["planDisk"] = args ? args.planDisk : undefined;
resourceInputs["publicHost"] = args ? args.publicHost : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["tag"] = args ? args.tag : undefined;
resourceInputs["trustedIps"] = args ? args.trustedIps : undefined;
resourceInputs["clusterTimeZone"] = undefined /*out*/;
resourceInputs["databaseEngine"] = undefined /*out*/;
resourceInputs["databaseEngineVersion"] = undefined /*out*/;
resourceInputs["dateCreated"] = undefined /*out*/;
resourceInputs["dbname"] = undefined /*out*/;
resourceInputs["host"] = undefined /*out*/;
resourceInputs["latestBackup"] = undefined /*out*/;
resourceInputs["maintenanceDow"] = undefined /*out*/;
resourceInputs["maintenanceTime"] = undefined /*out*/;
resourceInputs["password"] = undefined /*out*/;
resourceInputs["plan"] = undefined /*out*/;
resourceInputs["planRam"] = undefined /*out*/;
resourceInputs["planReplicas"] = undefined /*out*/;
resourceInputs["planVcpus"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["user"] = undefined /*out*/;
resourceInputs["vpcId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DatabaseReplica.__pulumiType, name, resourceInputs, opts);
}
}
exports.DatabaseReplica = DatabaseReplica;
/** @internal */
DatabaseReplica.__pulumiType = 'vultr:index/databaseReplica:DatabaseReplica';
//# sourceMappingURL=databaseReplica.js.map