class UserGroup (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ElastiCache.Alpha.UserGroup |
Go | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#UserGroup |
Java | software.amazon.awscdk.services.elasticache.alpha.UserGroup |
Python | aws_cdk.aws_elasticache_alpha.UserGroup |
TypeScript (source) | @aws-cdk/aws-elasticache-alpha ยป UserGroup |
Implements
IConstruct, IDependable, IResource, IEnvironment, IUser
An ElastiCache UserGroup.
Example
const newDefaultUser = new elasticache.NoPasswordUser(this, 'NoPasswordUser', {
userId: 'default',
accessControl: elasticache.AccessControl.fromAccessString("on ~* +@all"),
})
const userGroup = new elasticache.UserGroup(this, 'UserGroup', {
users: [newDefaultUser],
});
Initializer
new UserGroup(scope: Construct, id: string, props?: UserGroupProps)
Parameters
- scope
Construct - id
string - props
UserGroup Props
Construct Props
| Name | Type | Description |
|---|---|---|
| engine? | User | The engine type for the user group Enum options: UserEngine.VALKEY, UserEngine.REDIS. |
| user | string | Enforces a particular physical user group name. |
| users? | IUser[] | List of users inside the user group. |
engine?
Type:
User
(optional, default: UserEngine.VALKEY)
The engine type for the user group Enum options: UserEngine.VALKEY, UserEngine.REDIS.
userGroupName?
Type:
string
(optional, default:
Enforces a particular physical user group name.
users?
Type:
IUser[]
(optional, default: no users)
List of users inside the user group.
Properties
| Name | Type | Description |
|---|---|---|
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| user | string | The ARN of the user group. |
| user | string | The name of the user group. |
| user | string | The status of the user group Can be 'creating', 'active', 'modifying', 'deleting'. |
| engine? | User | The engine type for the user group. |
| users? | IUser[] | Array of users in the user group. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
userGroupArn
Type:
string
The ARN of the user group.
userGroupName
Type:
string
The name of the user group.
userGroupStatus
Type:
string
The status of the user group Can be 'creating', 'active', 'modifying', 'deleting'.
engine?
Type:
User
(optional)
The engine type for the user group.
users?
Type:
IUser[]
(optional)
Array of users in the user group.
Do not push directly to this array. Use addUser() instead to ensure proper validation and dependency management.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add a user to this user group. |
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| static from | Import an existing user group by ARN. |
| static from | Import an existing user group using attributes. |
| static from | Import an existing user group by name. |
| static is | Return whether the given object is a UserGroup. |
addUser(user)
public addUser(user: IUser): void
Parameters
- user
IUserโ The user to add to the group.
Add a user to this user group.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromUserGroupArn(scope, id, userGroupArn)
public static fromUserGroupArn(scope: Construct, id: string, userGroupArn: string): IUserGroup
Parameters
- scope
Constructโ The parent creating construct (usuallythis). - id
stringโ The construct's name. - userGroupArn
stringโ The ARN of the existing user group.
Returns
Import an existing user group by ARN.
static fromUserGroupAttributes(scope, id, attrs)
public static fromUserGroupAttributes(scope: Construct, id: string, attrs: UserGroupAttributes): IUserGroup
Parameters
- scope
Constructโ The parent creating construct (usuallythis). - id
stringโ The construct's name. - attrs
Userโ AGroup Attributes UserGroupAttributesobject.
Returns
Import an existing user group using attributes.
static fromUserGroupName(scope, id, userGroupName)
public static fromUserGroupName(scope: Construct, id: string, userGroupName: string): IUserGroup
Parameters
- scope
Constructโ The parent creating construct (usuallythis). - id
stringโ The construct's name. - userGroupName
stringโ The name of the existing user group.
Returns
Import an existing user group by name.
static isUserGroup(x)
public static isUserGroup(x: any): boolean
Parameters
- x
any
Returns
boolean
Return whether the given object is a UserGroup.

.NET
Go
Java
Python
TypeScript (