@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
144 lines • 5.54 kB
JavaScript
;
// *** 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 an ElastiCache user resource.
*
* > **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";
*
* const test = new aws.elasticache.User("test", {
* userId: "testUserId",
* userName: "testUserName",
* accessString: "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
* engine: "redis",
* passwords: ["password123456789"],
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.elasticache.User("test", {
* userId: "testUserId",
* userName: "testUserName",
* accessString: "on ~* +@all",
* engine: "redis",
* authenticationMode: {
* type: "iam",
* },
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.elasticache.User("test", {
* userId: "testUserId",
* userName: "testUserName",
* accessString: "on ~* +@all",
* engine: "redis",
* authenticationMode: {
* type: "password",
* passwords: [
* "password1",
* "password2",
* ],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import ElastiCache users using the `user_id`. For example:
*
* ```sh
* $ pulumi import aws:elasticache/user:User my_user userId1
* ```
*/
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["engine"] = state?.engine;
resourceInputs["noPasswordRequired"] = state?.noPasswordRequired;
resourceInputs["passwords"] = state?.passwords;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["userId"] = state?.userId;
resourceInputs["userName"] = state?.userName;
}
else {
const args = argsOrState;
if (args?.accessString === undefined && !opts.urn) {
throw new Error("Missing required property 'accessString'");
}
if (args?.engine === undefined && !opts.urn) {
throw new Error("Missing required property 'engine'");
}
if (args?.userId === undefined && !opts.urn) {
throw new Error("Missing required property 'userId'");
}
if (args?.userName === undefined && !opts.urn) {
throw new Error("Missing required property 'userName'");
}
resourceInputs["accessString"] = args?.accessString;
resourceInputs["authenticationMode"] = args?.authenticationMode;
resourceInputs["engine"] = args?.engine;
resourceInputs["noPasswordRequired"] = args?.noPasswordRequired;
resourceInputs["passwords"] = args?.passwords ? pulumi.secret(args.passwords) : undefined;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["userId"] = args?.userId;
resourceInputs["userName"] = args?.userName;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["passwords"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(User.__pulumiType, name, resourceInputs, opts);
}
}
exports.User = User;
/** @internal */
User.__pulumiType = 'aws:elasticache/user:User';
//# sourceMappingURL=user.js.map