ModifyUserGroupCommand

Changes the list of users that belong to the user group.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ElastiCacheClient, ModifyUserGroupCommand } from "@aws-sdk/client-elasticache"; // ES Modules import
// const { ElastiCacheClient, ModifyUserGroupCommand } = require("@aws-sdk/client-elasticache"); // CommonJS import
const client = new ElastiCacheClient(config);
const input = { // ModifyUserGroupMessage
  UserGroupId: "STRING_VALUE", // required
  UserIdsToAdd: [ // UserIdListInput
    "STRING_VALUE",
  ],
  UserIdsToRemove: [
    "STRING_VALUE",
  ],
  Engine: "STRING_VALUE",
};
const command = new ModifyUserGroupCommand(input);
const response = await client.send(command);
// { // UserGroup
//   UserGroupId: "STRING_VALUE",
//   Status: "STRING_VALUE",
//   Engine: "STRING_VALUE",
//   UserIds: [ // UserIdList
//     "STRING_VALUE",
//   ],
//   MinimumEngineVersion: "STRING_VALUE",
//   PendingChanges: { // UserGroupPendingChanges
//     UserIdsToRemove: [
//       "STRING_VALUE",
//     ],
//     UserIdsToAdd: [
//       "STRING_VALUE",
//     ],
//   },
//   ReplicationGroups: [ // UGReplicationGroupIdList
//     "STRING_VALUE",
//   ],
//   ServerlessCaches: [ // UGServerlessCacheIdList
//     "STRING_VALUE",
//   ],
//   ARN: "STRING_VALUE",
// };

ModifyUserGroupCommand Input

See ModifyUserGroupCommandInput for more details

Parameter
Type
Description
UserGroupId
Required
string | undefined

The ID of the user group.

Engine
string | undefined

Modifies the engine listed in a user group. The options are valkey or redis.

UserIdsToAdd
string[] | undefined

The list of user IDs to add to the user group.

UserIdsToRemove
string[] | undefined

The list of user IDs to remove from the user group.

ModifyUserGroupCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
ARN
string | undefined

The Amazon Resource Name (ARN) of the user group.

Engine
string | undefined

The options are valkey or redis.

MinimumEngineVersion
string | undefined

The minimum engine version required, which is Redis OSS 6.0

PendingChanges
UserGroupPendingChanges | undefined

A list of updates being applied to the user group.

ReplicationGroups
string[] | undefined

A list of replication groups that the user group can access.

ServerlessCaches
string[] | undefined

Indicates which serverless caches the specified user group is associated with. Available for Valkey, Redis OSS and Serverless Memcached only.

Status
string | undefined

Indicates user group status. Can be "creating", "active", "modifying", "deleting".

UserGroupId
string | undefined

The ID of the user group.

UserIds
string[] | undefined

The list of user IDs that belong to the user group.

Throws

Name
Fault
Details
DefaultUserRequired
client

You must add default user to a user group.

DuplicateUserNameFault
client

A user with this username already exists.

InvalidParameterCombinationException
client

Two or more incompatible parameters were specified.

InvalidParameterValueException
client

The value for a parameter is invalid.

InvalidUserGroupStateFault
client

The user group is not in an active state.

ServiceLinkedRoleNotFoundFault
client

The specified service linked role (SLR) was not found.

UserGroupNotFoundFault
client

The user group was not found or does not exist

UserNotFoundFault
client

The user does not exist or could not be found.

ElastiCacheServiceException
Base exception class for all service exceptions from ElastiCache service.