class IamUser (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ElastiCache.Alpha.IamUser |
Go | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#IamUser |
Java | software.amazon.awscdk.services.elasticache.alpha.IamUser |
Python | aws_cdk.aws_elasticache_alpha.IamUser |
TypeScript (source) | @aws-cdk/aws-elasticache-alpha ยป IamUser |
Implements
IConstruct, IDependable, IResource, IEnvironment, IUser
Define an ElastiCache user with IAM authentication.
Example
const user = new elasticache.IamUser(this, 'User', {
// set user engine
engine: elasticache.UserEngine.REDIS,
// set user id
userId: 'my-user',
// set username
userName: 'my-user',
// set access string
accessControl: elasticache.AccessControl.fromAccessString("on ~* +@all"),
});
Initializer
new IamUser(scope: Construct, id: string, props: IamUserProps)
Parameters
- scope
Construct - id
string - props
IamUser 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 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.
For IAM authentication userName must be equal to userId.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grant the given identity custom permissions. |
| grant | Grant connect permissions to the given IAM identity. |
| to | Returns a string representation of this construct. |
| static is | Return whether the given object is an IamUser. |
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).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantableโ The IAM identity to grant permissions to. - actions
stringโ The actions to grant.
Returns
Grant the given identity custom permissions.
grantConnect(grantee)
public grantConnect(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ The IAM identity to grant permissions to.
Returns
Grant connect permissions to the given IAM identity.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static isIamUser(x)
public static isIamUser(x: any): boolean
Parameters
- x
any
Returns
boolean
Return whether the given object is an IamUser.

.NET
Go
Java
Python
TypeScript (