class PasswordUser (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElastiCache.Alpha.PasswordUser |
![]() | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#PasswordUser |
![]() | software.amazon.awscdk.services.elasticache.alpha.PasswordUser |
![]() | aws_cdk.aws_elasticache_alpha.PasswordUser |
![]() | @aws-cdk/aws-elasticache-alpha ยป PasswordUser |
Implements
IConstruct
, IDependable
, IResource
, 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
Password
User 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 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.
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
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 isPasswordUser(x)
public static isPasswordUser(x: any): boolean
Parameters
- x
any
Returns
boolean
Return whether the given object is a PasswordUser
.