Skip to main content

user_groups

Creates, updates, deletes, gets or lists a user_groups resource.

Overview

Nameuser_groups
TypeResource
Idaws.elasticache.user_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the user group.
enginestringThe options are valkey or redis.
minimum_engine_versionstringThe minimum engine version required, which is Redis OSS 6.0
pending_changesstringA list of updates being applied to the user group.
replication_groupsstringA list of replication groups that the user group can access.
serverless_cachesstringIndicates which serverless caches the specified user group is associated with. Available for Valkey, Redis OSS and Serverless Memcached only.
statusstringIndicates user group status. Can be "creating", "active", "modifying", "deleting".
user_group_idstringThe ID of the user group.
user_idsstringThe list of user IDs that belong to the user group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_user_groupsselectregionUserGroupId, MaxRecords, MarkerReturns a list of user groups.
create_user_groupinsertUserGroupId, regionEngine, UserIds, TagsFor 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)
modify_user_groupupdateUserGroupId, regionUserIdsToAdd, UserIdsToRemove, EngineChanges the list of users that belong to the user group.
delete_user_groupdeleteUserGroupId, regionFor Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Deletes a user group. The user group must first be disassociated from the replication group before it can be deleted. For more information, see Using Role Based Access Control (RBAC).

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
UserGroupIdstringThe ID of the user group.
regionstringAWS region (default: us-east-1)
EnginestringModifies the engine listed in a user group. The options are valkey or redis.
MarkerstringAn optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords. >
MaxRecordsintegerThe maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a marker is included in the response so that the remaining results can be retrieved.
TagsarrayA 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.
UserGroupIdstringThe ID of the user group.
UserIdsarrayThe list of user IDs that belong to the user group.
UserIdsToAddarrayThe list of user IDs to add to the user group.
UserIdsToRemovearrayThe list of user IDs to remove from the user group.

SELECT examples

Returns a list of user groups.

SELECT
arn,
engine,
minimum_engine_version,
pending_changes,
replication_groups,
serverless_caches,
status,
user_group_id,
user_ids
FROM aws.elasticache.user_groups
WHERE region = '{{ region }}' -- required
AND UserGroupId = '{{ UserGroupId }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;

INSERT examples

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)

INSERT INTO aws.elasticache.user_groups (
UserGroupId,
region,
Engine,
UserIds,
Tags
)
SELECT
'{{ UserGroupId }}',
'{{ region }}',
'{{ Engine }}',
'{{ UserIds }}',
'{{ Tags }}'
RETURNING
arn,
engine,
minimum_engine_version,
pending_changes,
replication_groups,
serverless_caches,
status,
user_group_id,
user_ids
;

UPDATE examples

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

UPDATE aws.elasticache.user_groups
SET
-- No updatable properties
WHERE
UserGroupId = '{{ UserGroupId }}' --required
AND region = '{{ region }}' --required
AND UserIdsToAdd = '{{ UserIdsToAdd}}'
AND UserIdsToRemove = '{{ UserIdsToRemove}}'
AND Engine = '{{ Engine}}'
RETURNING
arn,
engine,
minimum_engine_version,
pending_changes,
replication_groups,
serverless_caches,
status,
user_group_id,
user_ids;

DELETE examples

For Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Deletes a user group. The user group must first be disassociated from the replication group before it can be deleted. For more information, see Using Role Based Access Control (RBAC).

DELETE FROM aws.elasticache.user_groups
WHERE UserGroupId = '{{ UserGroupId }}' --required
AND region = '{{ region }}' --required
;