@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
136 lines • 6.69 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.ManagedDatabaseOpensearch = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents OpenSearch 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.ManagedDatabaseOpensearch("example_1", {
* name: "opensearch-1",
* title: "opensearch-1-example-1",
* plan: "1x2xCPU-4GB-80GB-1D",
* zone: "fi-hel2",
* });
* // Service with custom properties and access control
* const example2 = new upcloud.ManagedDatabaseOpensearch("example_2", {
* name: "opensearch-2",
* title: "opensearch-2-example-2",
* plan: "1x2xCPU-4GB-80GB-1D",
* zone: "fi-hel1",
* accessControl: true,
* extendedAccessControl: true,
* properties: {
* publicAccess: false,
* },
* });
* ```
*/
class ManagedDatabaseOpensearch extends pulumi.CustomResource {
/**
* Get an existing ManagedDatabaseOpensearch 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 ManagedDatabaseOpensearch(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedDatabaseOpensearch. 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'] === ManagedDatabaseOpensearch.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessControl"] = state?.accessControl;
resourceInputs["additionalDiskSpaceGib"] = state?.additionalDiskSpaceGib;
resourceInputs["components"] = state?.components;
resourceInputs["extendedAccessControl"] = state?.extendedAccessControl;
resourceInputs["labels"] = state?.labels;
resourceInputs["maintenanceWindowDow"] = state?.maintenanceWindowDow;
resourceInputs["maintenanceWindowTime"] = state?.maintenanceWindowTime;
resourceInputs["name"] = state?.name;
resourceInputs["networks"] = state?.networks;
resourceInputs["nodeStates"] = state?.nodeStates;
resourceInputs["plan"] = state?.plan;
resourceInputs["powered"] = state?.powered;
resourceInputs["primaryDatabase"] = state?.primaryDatabase;
resourceInputs["properties"] = state?.properties;
resourceInputs["serviceHost"] = state?.serviceHost;
resourceInputs["servicePassword"] = state?.servicePassword;
resourceInputs["servicePort"] = state?.servicePort;
resourceInputs["serviceUri"] = state?.serviceUri;
resourceInputs["serviceUsername"] = state?.serviceUsername;
resourceInputs["state"] = state?.state;
resourceInputs["terminationProtection"] = state?.terminationProtection;
resourceInputs["title"] = state?.title;
resourceInputs["type"] = state?.type;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.plan === undefined && !opts.urn) {
throw new Error("Missing required property 'plan'");
}
if (args?.title === undefined && !opts.urn) {
throw new Error("Missing required property 'title'");
}
if (args?.zone === undefined && !opts.urn) {
throw new Error("Missing required property 'zone'");
}
resourceInputs["accessControl"] = args?.accessControl;
resourceInputs["additionalDiskSpaceGib"] = args?.additionalDiskSpaceGib;
resourceInputs["extendedAccessControl"] = args?.extendedAccessControl;
resourceInputs["labels"] = args?.labels;
resourceInputs["maintenanceWindowDow"] = args?.maintenanceWindowDow;
resourceInputs["maintenanceWindowTime"] = args?.maintenanceWindowTime;
resourceInputs["name"] = args?.name;
resourceInputs["networks"] = args?.networks;
resourceInputs["plan"] = args?.plan;
resourceInputs["powered"] = args?.powered;
resourceInputs["properties"] = args?.properties;
resourceInputs["terminationProtection"] = args?.terminationProtection;
resourceInputs["title"] = args?.title;
resourceInputs["zone"] = args?.zone;
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["state"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["servicePassword", "serviceUri"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ManagedDatabaseOpensearch.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedDatabaseOpensearch = ManagedDatabaseOpensearch;
/** @internal */
ManagedDatabaseOpensearch.__pulumiType = 'upcloud:index/managedDatabaseOpensearch:ManagedDatabaseOpensearch';
//# sourceMappingURL=managedDatabaseOpensearch.js.map