UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

90 lines 3.81 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.User = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V1 DB user resource within OpenStack. * * > **Note:** All arguments including the database password will be stored in the * raw state as plain-text. Read more about sensitive data in * state. * * ## Example Usage * * ### User * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const basic = new openstack.database.User("basic", { * name: "basic", * instanceId: basicOpenstackDbInstanceV1.id, * password: "password", * databases: ["testdb"], * }); * ``` */ class User extends pulumi.CustomResource { /** * Get an existing User 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 User(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of User. 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'] === User.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["databases"] = state ? state.databases : undefined; resourceInputs["host"] = state ? state.host : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.password === undefined) && !opts.urn) { throw new Error("Missing required property 'password'"); } resourceInputs["databases"] = args ? args.databases : undefined; resourceInputs["host"] = args ? args.host : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'openstack:database/user:User'; //# sourceMappingURL=user.js.map