UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

105 lines 4.35 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"); /** * Provides a MemoryDB User. * * More information about users and ACL-s can be found in the [MemoryDB User Guide](https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html). * * > **Note:** All arguments including the username and passwords will be stored in the raw state as plain-text. * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as random from "@pulumi/random"; * * const example = new random.index.Password("example", {length: 16}); * const exampleUser = new aws.memorydb.User("example", { * userName: "my-user", * accessString: "on ~* &* +@all", * authenticationMode: { * type: "password", * passwords: [example.result], * }, * }); * ``` * * ## Import * * Using `pulumi import`, import a user using the `user_name`. For example: * * ```sh * $ pulumi import aws:memorydb/user:User example my-user * ``` * The `passwords` are not available for imported resources, as this information cannot be read back from the MemoryDB API. */ 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, { ...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["accessString"] = state?.accessString; resourceInputs["arn"] = state?.arn; resourceInputs["authenticationMode"] = state?.authenticationMode; resourceInputs["minimumEngineVersion"] = state?.minimumEngineVersion; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["userName"] = state?.userName; } else { const args = argsOrState; if (args?.accessString === undefined && !opts.urn) { throw new Error("Missing required property 'accessString'"); } if (args?.authenticationMode === undefined && !opts.urn) { throw new Error("Missing required property 'authenticationMode'"); } if (args?.userName === undefined && !opts.urn) { throw new Error("Missing required property 'userName'"); } resourceInputs["accessString"] = args?.accessString; resourceInputs["authenticationMode"] = args?.authenticationMode; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["userName"] = args?.userName; resourceInputs["arn"] = undefined /*out*/; resourceInputs["minimumEngineVersion"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'aws:memorydb/user:User'; //# sourceMappingURL=user.js.map