class PasswordUser (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ElastiCache.Alpha.PasswordUser |
Go | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#PasswordUser |
Java | software.amazon.awscdk.services.elasticache.alpha.PasswordUser |
Python | aws_cdk.aws_elasticache_alpha.PasswordUser |
TypeScript (source) | @aws-cdk/aws-elasticache-alpha ยป PasswordUser |
Implements
IConstruct, IDependable, IResource, IEnvironment, IUser
Define an ElastiCache user with password authentication.
Example
const user = new elasticache.PasswordUser(this, 'User', {
// set user engine
engine: elasticache.UserEngine.VALKEY,
// set user id
userId: 'my-user-id',
// set access string
accessControl: elasticache.AccessControl.fromAccessString("on ~* +@all"),
// set username
userName: 'my-user-name',
// set up to two passwords
passwords: [
// "SecretIdForPassword" is the secret id for the password
SecretValue.secretsManager('SecretIdForPassword'),
// "AnotherSecretIdForPassword" is the secret id for the password
SecretValue.secretsManager('AnotherSecretIdForPassword'),
],
});
Initializer
new PasswordUser(scope: Construct, id: string, props: PasswordUserProps)
Parameters
- scope
Construct - id
string - props
PasswordUser Props
Construct Props
| Name | Type | Description |
|---|---|---|
| access | Access | Access control configuration for the user. |
| passwords | Secret[] | The passwords for the user. |
| user | string | The ID of the user. |
| engine? | User | The engine type for the user. |
| user | string | The name of the user. |
accessControl
Type:
Access
Access control configuration for the user.
passwords
Type:
Secret[]
The passwords for the user.
Password authentication requires using 1-2 passwords.
userId
Type:
string
The ID of the user.
engine?
Type:
User
(optional, default: UserEngine.VALKEY.)
The engine type for the user.
Enum options: UserEngine.VALKEY, UserEngine.REDIS.
userName?
Type:
string
(optional, default: Same as userId.)
The name of the user.
Properties
| Name | Type | Description |
|---|---|---|
| access | string | The access string that defines the user's permissions. |
| 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 user's ARN. |
| user | string | The user's ID. |
| user | string | The user's status. |
| engine? | User | The engine for the user. |
| user | string | The user's name. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
accessString
Type:
string
The access string that defines the user's permissions.
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.
userArn
Type:
string
The user's ARN.
userId
Type:
string
The user's ID.
userStatus
Type:
string
The user's status.
Can be 'active', 'modifying', 'deleting'.
engine?
Type:
User
(optional)
The engine for the user.
userName?
Type:
string
(optional)
The user's name.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| static is | Return whether the given object is a PasswordUser. |
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 isPasswordUser(x)
public static isPasswordUser(x: any): boolean
Parameters
- x
any
Returns
boolean
Return whether the given object is a PasswordUser.

.NET
Go
Java
Python
TypeScript (