Skip to main content

users

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

Overview

Nameusers
TypeResource
Idaws.elasticache.users

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the user.
access_stringstringAccess permissions string used for this user.
authenticationstringDenotes whether the user requires a password to authenticate.
enginestringThe options are valkey or redis.
minimum_engine_versionstringThe minimum engine version required, which is Redis OSS 6.0
statusstringIndicates the user status. Can be "active", "modifying" or "deleting".
user_group_idsstringReturns a list of the user group IDs the user belongs to.
user_idstringThe ID of the user.
user_namestringThe username of the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_usersselectregionEngine, UserId, Filters, MaxRecords, MarkerReturns a list of users.
create_userinsertUserId, UserName, AccessString, regionEngine, Passwords, NoPasswordRequired, Tags, AuthenticationModeFor Valkey engine version 7.2 onwards and Redis OSS 6.0 to 7.1: Creates a user. For more information, see Using Role Based Access Control (RBAC).
modify_userupdateUserId, regionAccessString, AppendAccessString, Passwords, NoPasswordRequired, AuthenticationMode, EngineChanges user password(s) and/or access string.
delete_userdeleteUserId, regionFor Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Deletes a user. The user will be removed from all user groups and in turn removed from all replication groups. 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
AccessStringstringAccess permissions string used for this user.
UserIdstringThe ID of the user.
UserNamestringThe username of the user.
regionstringAWS region (default: us-east-1)
AccessStringstringAccess permissions string used for this user.
AppendAccessStringstringAdds additional user permissions to the access string.
AuthenticationModeobjectSpecifies how to authenticate the user.
EnginestringModifies the engine listed for a user. The options are valkey or redis.
FiltersarrayFilter to determine the list of User IDs to return.
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.
NoPasswordRequiredbooleanIndicates no password is required for the user.
PasswordsarrayThe passwords belonging to the user. You are allowed up to two.
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.
UserIdstringThe ID of the user.

SELECT examples

Returns a list of users.

SELECT
arn,
access_string,
authentication,
engine,
minimum_engine_version,
status,
user_group_ids,
user_id,
user_name
FROM aws.elasticache.users
WHERE region = '{{ region }}' -- required
AND Engine = '{{ Engine }}'
AND UserId = '{{ UserId }}'
AND Filters = '{{ Filters }}'
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. For more information, see Using Role Based Access Control (RBAC).

INSERT INTO aws.elasticache.users (
UserId,
UserName,
AccessString,
region,
Engine,
Passwords,
NoPasswordRequired,
Tags,
AuthenticationMode
)
SELECT
'{{ UserId }}',
'{{ UserName }}',
'{{ AccessString }}',
'{{ region }}',
'{{ Engine }}',
'{{ Passwords }}',
'{{ NoPasswordRequired }}',
'{{ Tags }}',
'{{ AuthenticationMode }}'
RETURNING
arn,
access_string,
authentication,
engine,
minimum_engine_version,
status,
user_group_ids,
user_id,
user_name
;

UPDATE examples

Changes user password(s) and/or access string.

UPDATE aws.elasticache.users
SET
-- No updatable properties
WHERE
UserId = '{{ UserId }}' --required
AND region = '{{ region }}' --required
AND AccessString = '{{ AccessString}}'
AND AppendAccessString = '{{ AppendAccessString}}'
AND Passwords = '{{ Passwords}}'
AND NoPasswordRequired = {{ NoPasswordRequired}}
AND AuthenticationMode = '{{ AuthenticationMode}}'
AND Engine = '{{ Engine}}'
RETURNING
arn,
access_string,
authentication,
engine,
minimum_engine_version,
status,
user_group_ids,
user_id,
user_name;

DELETE examples

For Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Deletes a user. The user will be removed from all user groups and in turn removed from all replication groups. For more information, see Using Role Based Access Control (RBAC).

DELETE FROM aws.elasticache.users
WHERE UserId = '{{ UserId }}' --required
AND region = '{{ region }}' --required
;