@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
134 lines • 7.27 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.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, Object.assign(Object.assign({}, 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 ? state.accessControl : undefined;
resourceInputs["components"] = state ? state.components : undefined;
resourceInputs["extendedAccessControl"] = state ? state.extendedAccessControl : 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["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["accessControl"] = args ? args.accessControl : undefined;
resourceInputs["extendedAccessControl"] = args ? args.extendedAccessControl : undefined;
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["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