UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

93 lines 4.1 kB
"use strict"; // *** 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.ManagedDatabaseUser = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource represents a user in managed database. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as upcloud from "@upcloud/pulumi-upcloud"; * * const example = new upcloud.ManagedDatabasePostgresql("example", { * name: "postgres", * plan: "1x1xCPU-2GB-25GB", * title: "postgres", * zone: "fi-hel1", * }); * const exampleUser = new upcloud.ManagedDatabaseUser("example_user", { * service: example.id, * username: "example_user", * password: "<USER_PASSWORD>", * }); * ``` */ class ManagedDatabaseUser extends pulumi.CustomResource { /** * Get an existing ManagedDatabaseUser 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 ManagedDatabaseUser(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ManagedDatabaseUser. 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'] === ManagedDatabaseUser.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authentication"] = state?.authentication; resourceInputs["opensearchAccessControl"] = state?.opensearchAccessControl; resourceInputs["password"] = state?.password; resourceInputs["pgAccessControl"] = state?.pgAccessControl; resourceInputs["service"] = state?.service; resourceInputs["type"] = state?.type; resourceInputs["username"] = state?.username; resourceInputs["valkeyAccessControl"] = state?.valkeyAccessControl; } else { const args = argsOrState; if (args?.service === undefined && !opts.urn) { throw new Error("Missing required property 'service'"); } if (args?.username === undefined && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["authentication"] = args?.authentication; resourceInputs["opensearchAccessControl"] = args?.opensearchAccessControl; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["pgAccessControl"] = args?.pgAccessControl; resourceInputs["service"] = args?.service; resourceInputs["username"] = args?.username; resourceInputs["valkeyAccessControl"] = args?.valkeyAccessControl; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ManagedDatabaseUser.__pulumiType, name, resourceInputs, opts); } } exports.ManagedDatabaseUser = ManagedDatabaseUser; /** @internal */ ManagedDatabaseUser.__pulumiType = 'upcloud:index/managedDatabaseUser:ManagedDatabaseUser'; //# sourceMappingURL=managedDatabaseUser.js.map