UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

124 lines 5.64 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 V3 User resource within OpenStack Keystone. * * > **Note:** All arguments including the user password will be stored in the * raw state as plain-text. Read more about sensitive data in * state. * * > **Note:** You _must_ have admin privileges in your OpenStack cloud to use * this resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const project1 = new openstack.identity.Project("project_1", {name: "project_1"}); * const user1 = new openstack.identity.User("user_1", { * defaultProjectId: project1.id, * name: "user_1", * description: "A user", * password: "password123", * ignoreChangePasswordUponFirstUse: true, * multiFactorAuthEnabled: true, * multiFactorAuthRules: [ * { * rules: [ * "password", * "totp", * ], * }, * { * rules: ["password"], * }, * ], * extra: { * email: "user_1@foobar.com", * }, * }); * ``` * * ## Import * * Users can be imported using the `id`, e.g. * * ```sh * $ pulumi import openstack:identity/user:User user_1 89c60255-9bd6-460c-822a-e2b959ede9d2 * ``` */ 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["defaultProjectId"] = state ? state.defaultProjectId : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["domainId"] = state ? state.domainId : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["extra"] = state ? state.extra : undefined; resourceInputs["ignoreChangePasswordUponFirstUse"] = state ? state.ignoreChangePasswordUponFirstUse : undefined; resourceInputs["ignoreLockoutFailureAttempts"] = state ? state.ignoreLockoutFailureAttempts : undefined; resourceInputs["ignorePasswordExpiry"] = state ? state.ignorePasswordExpiry : undefined; resourceInputs["multiFactorAuthEnabled"] = state ? state.multiFactorAuthEnabled : undefined; resourceInputs["multiFactorAuthRules"] = state ? state.multiFactorAuthRules : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; resourceInputs["defaultProjectId"] = args ? args.defaultProjectId : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["domainId"] = args ? args.domainId : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["extra"] = args ? args.extra : undefined; resourceInputs["ignoreChangePasswordUponFirstUse"] = args ? args.ignoreChangePasswordUponFirstUse : undefined; resourceInputs["ignoreLockoutFailureAttempts"] = args ? args.ignoreLockoutFailureAttempts : undefined; resourceInputs["ignorePasswordExpiry"] = args ? args.ignorePasswordExpiry : undefined; resourceInputs["multiFactorAuthEnabled"] = args ? args.multiFactorAuthEnabled : undefined; resourceInputs["multiFactorAuthRules"] = args ? args.multiFactorAuthRules : 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:identity/user:User'; //# sourceMappingURL=user.js.map