@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
132 lines • 7 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedDatabasePostgresql = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents PostgreSQL managed database. See UpCloud [Managed Databases](https://upcloud.com/products/managed-databases) product page for more details about the service.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Minimal config
* const example1 = new upcloud.ManagedDatabasePostgresql("example_1", {
* name: "postgres-1",
* plan: "1x1xCPU-2GB-25GB",
* title: "postgres",
* zone: "fi-hel1",
* });
* // Service with custom properties
* const example2 = new upcloud.ManagedDatabasePostgresql("example_2", {
* name: "postgres-2",
* plan: "1x1xCPU-2GB-25GB",
* title: "postgres",
* zone: "fi-hel1",
* properties: {
* timezone: "Europe/Helsinki",
* adminUsername: "admin",
* adminPassword: "<ADMIN_PASSWORD>",
* },
* });
* ```
*/
class ManagedDatabasePostgresql extends pulumi.CustomResource {
/**
* Get an existing ManagedDatabasePostgresql 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 ManagedDatabasePostgresql(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ManagedDatabasePostgresql. 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'] === ManagedDatabasePostgresql.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["components"] = state ? state.components : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["maintenanceWindowDow"] = state ? state.maintenanceWindowDow : undefined;
resourceInputs["maintenanceWindowTime"] = state ? state.maintenanceWindowTime : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networks"] = state ? state.networks : undefined;
resourceInputs["nodeStates"] = state ? state.nodeStates : undefined;
resourceInputs["plan"] = state ? state.plan : undefined;
resourceInputs["powered"] = state ? state.powered : undefined;
resourceInputs["primaryDatabase"] = state ? state.primaryDatabase : undefined;
resourceInputs["properties"] = state ? state.properties : undefined;
resourceInputs["serviceHost"] = state ? state.serviceHost : undefined;
resourceInputs["servicePassword"] = state ? state.servicePassword : undefined;
resourceInputs["servicePort"] = state ? state.servicePort : undefined;
resourceInputs["serviceUri"] = state ? state.serviceUri : undefined;
resourceInputs["serviceUsername"] = state ? state.serviceUsername : undefined;
resourceInputs["sslmode"] = state ? state.sslmode : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["terminationProtection"] = state ? state.terminationProtection : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.plan === undefined) && !opts.urn) {
throw new Error("Missing required property 'plan'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
if ((!args || args.zone === undefined) && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["maintenanceWindowDow"] = args ? args.maintenanceWindowDow : undefined;
resourceInputs["maintenanceWindowTime"] = args ? args.maintenanceWindowTime : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networks"] = args ? args.networks : undefined;
resourceInputs["plan"] = args ? args.plan : undefined;
resourceInputs["powered"] = args ? args.powered : undefined;
resourceInputs["properties"] = args ? args.properties : undefined;
resourceInputs["terminationProtection"] = args ? args.terminationProtection : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["components"] = undefined /*out*/;
resourceInputs["nodeStates"] = undefined /*out*/;
resourceInputs["primaryDatabase"] = undefined /*out*/;
resourceInputs["serviceHost"] = undefined /*out*/;
resourceInputs["servicePassword"] = undefined /*out*/;
resourceInputs["servicePort"] = undefined /*out*/;
resourceInputs["serviceUri"] = undefined /*out*/;
resourceInputs["serviceUsername"] = undefined /*out*/;
resourceInputs["sslmode"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["servicePassword", "serviceUri"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ManagedDatabasePostgresql.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedDatabasePostgresql = ManagedDatabasePostgresql;
/** @internal */
ManagedDatabasePostgresql.__pulumiType = 'upcloud:index/managedDatabasePostgresql:ManagedDatabasePostgresql';
//# sourceMappingURL=managedDatabasePostgresql.js.map