class NoPasswordUser (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElastiCache.Alpha.NoPasswordUser |
![]() | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#NoPasswordUser |
![]() | software.amazon.awscdk.services.elasticache.alpha.NoPasswordUser |
![]() | aws_cdk.aws_elasticache_alpha.NoPasswordUser |
![]() | @aws-cdk/aws-elasticache-alpha ยป NoPasswordUser |
Implements
IConstruct
, IDependable
, IResource
, IUser
Define an ElastiCache user with no password authentication.
Example
// use the original `default` user by using import method
const defaultUser = elasticache.NoPasswordUser.fromUserAttributes(this, 'DefaultUser', {
// userId and userName must be 'default'
userId: 'default',
});
// create a new default user
const newDefaultUser = new elasticache.NoPasswordUser(this, 'NewDefaultUser', {
// new default user id must not be 'default'
userId: 'new-default',
// new default username must be 'default'
userName: 'default',
// set access string
accessControl: elasticache.AccessControl.fromAccessString("on ~* +@all"),
});
Initializer
new NoPasswordUser(scope: Construct, id: string, props: NoPasswordUserProps)
Parameters
- scope
Construct
- id
string
- props
No
Password User Props
Construct Props
Name | Type | Description |
---|---|---|
access | Access | Access control configuration 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.
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 NoPasswordUser . |
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 isNoPasswordUser(x)
public static isNoPasswordUser(x: any): boolean
Parameters
- x
any
Returns
boolean
Return whether the given object is a NoPasswordUser
.