@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
91 lines • 3.81 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.ManagedDatabaseLogicalDatabase = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents a logical database in managed database
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // PostgreSQL managed database with additional logical database: example_db
* const example = new upcloud.ManagedDatabasePostgresql("example", {
* name: "postgres",
* plan: "1x1xCPU-2GB-25GB",
* title: "postgres",
* zone: "fi-hel1",
* });
* const exampleDb = new upcloud.ManagedDatabaseLogicalDatabase("example_db", {
* service: example.id,
* name: "example_db",
* });
* // MySQL managed database with additional logical database: example2_db
* const exampleManagedDatabaseMysql = new upcloud.ManagedDatabaseMysql("example", {
* name: "mysql",
* plan: "1x1xCPU-2GB-25GB",
* title: "mysql",
* zone: "fi-hel1",
* });
* const example2Db = new upcloud.ManagedDatabaseLogicalDatabase("example2_db", {
* service: exampleManagedDatabaseMysql.id,
* name: "example2_db",
* });
* ```
*/
class ManagedDatabaseLogicalDatabase extends pulumi.CustomResource {
/**
* Get an existing ManagedDatabaseLogicalDatabase 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 ManagedDatabaseLogicalDatabase(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedDatabaseLogicalDatabase. 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'] === ManagedDatabaseLogicalDatabase.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["characterSet"] = state?.characterSet;
resourceInputs["collation"] = state?.collation;
resourceInputs["name"] = state?.name;
resourceInputs["service"] = state?.service;
}
else {
const args = argsOrState;
if (args?.service === undefined && !opts.urn) {
throw new Error("Missing required property 'service'");
}
resourceInputs["characterSet"] = args?.characterSet;
resourceInputs["collation"] = args?.collation;
resourceInputs["name"] = args?.name;
resourceInputs["service"] = args?.service;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedDatabaseLogicalDatabase.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedDatabaseLogicalDatabase = ManagedDatabaseLogicalDatabase;
/** @internal */
ManagedDatabaseLogicalDatabase.__pulumiType = 'upcloud:index/managedDatabaseLogicalDatabase:ManagedDatabaseLogicalDatabase';
//# sourceMappingURL=managedDatabaseLogicalDatabase.js.map