class UserGroup (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElastiCache.Alpha.UserGroup |
![]() | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#UserGroup |
![]() | software.amazon.awscdk.services.elasticache.alpha.UserGroup |
![]() | aws_cdk.aws_elasticache_alpha.UserGroup |
![]() | @aws-cdk/aws-elasticache-alpha ยป UserGroup |
Implements
IConstruct
, IDependable
, IResource
, 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
User
Group 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 by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that 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
Removal
Policy
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 UserGroupAttributes
object.
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
.