CreateUserGroupCommand

For Valkey engine version 7.2 onwards and Redis OSS 6.0 to 7.1: Creates a user group. For more information, see Using Role Based Access Control (RBAC) 

Example Syntax

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

import { ElastiCacheClient, CreateUserGroupCommand } from "@aws-sdk/client-elasticache"; // ES Modules import
// const { ElastiCacheClient, CreateUserGroupCommand } = require("@aws-sdk/client-elasticache"); // CommonJS import
const client = new ElastiCacheClient(config);
const input = { // CreateUserGroupMessage
  UserGroupId: "STRING_VALUE", // required
  Engine: "STRING_VALUE", // required
  UserIds: [ // UserIdListInput
    "STRING_VALUE",
  ],
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new CreateUserGroupCommand(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",
// };

CreateUserGroupCommand Input

See CreateUserGroupCommandInput for more details

Parameter
Type
Description
Engine
Required
string | undefined

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

UserGroupId
Required
string | undefined

The ID of the user group.

Tags
Tag[] | undefined

A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted. Available for Valkey and Redis OSS only.

UserIds
string[] | undefined

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

CreateUserGroupCommand 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.

InvalidParameterValueException
client

The value for a parameter is invalid.

ServiceLinkedRoleNotFoundFault
client

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

TagQuotaPerResourceExceeded
client

The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.

UserGroupAlreadyExistsFault
client

The user group with this ID already exists.

UserGroupQuotaExceededFault
client

The number of users exceeds the user group limit.

UserNotFoundFault
client

The user does not exist or could not be found.

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