@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
103 lines • 4.5 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.UserGroupAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Associate an existing ElastiCache user and an existing user group.
*
* > Pulumi will detect changes in the `aws.elasticache.UserGroup` since `aws.elasticache.UserGroupAssociation` changes the user IDs associated with the user group. You can ignore these changes with the `lifecycle` `ignoreChanges` meta argument as shown in the example.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const _default = new aws.elasticache.User("default", {
* userId: "defaultUserID",
* userName: "default",
* accessString: "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
* engine: "REDIS",
* passwords: ["password123456789"],
* });
* const example = new aws.elasticache.UserGroup("example", {
* engine: "REDIS",
* userGroupId: "userGroupId",
* userIds: [_default.userId],
* });
* const exampleUser = new aws.elasticache.User("example", {
* userId: "exampleUserID",
* userName: "exampleuser",
* accessString: "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
* engine: "REDIS",
* passwords: ["password123456789"],
* });
* const exampleUserGroupAssociation = new aws.elasticache.UserGroupAssociation("example", {
* userGroupId: example.userGroupId,
* userId: exampleUser.userId,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import ElastiCache user group associations using the `user_group_id` and `user_id`. For example:
*
* ```sh
* $ pulumi import aws:elasticache/userGroupAssociation:UserGroupAssociation example userGoupId1,userId
* ```
*/
class UserGroupAssociation extends pulumi.CustomResource {
/**
* Get an existing UserGroupAssociation 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 UserGroupAssociation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UserGroupAssociation. 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'] === UserGroupAssociation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["region"] = state?.region;
resourceInputs["userGroupId"] = state?.userGroupId;
resourceInputs["userId"] = state?.userId;
}
else {
const args = argsOrState;
if (args?.userGroupId === undefined && !opts.urn) {
throw new Error("Missing required property 'userGroupId'");
}
if (args?.userId === undefined && !opts.urn) {
throw new Error("Missing required property 'userId'");
}
resourceInputs["region"] = args?.region;
resourceInputs["userGroupId"] = args?.userGroupId;
resourceInputs["userId"] = args?.userId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserGroupAssociation.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserGroupAssociation = UserGroupAssociation;
/** @internal */
UserGroupAssociation.__pulumiType = 'aws:elasticache/userGroupAssociation:UserGroupAssociation';
//# sourceMappingURL=userGroupAssociation.js.map