class IamUser (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElastiCache.Alpha.IamUser |
![]() | github.com/aws/aws-cdk-go/awscdkelasticachealpha/v2#IamUser |
![]() | software.amazon.awscdk.services.elasticache.alpha.IamUser |
![]() | aws_cdk.aws_elasticache_alpha.IamUser |
![]() | @aws-cdk/aws-elasticache-alpha ยป IamUser |
Implements
IConstruct
, IDependable
, IResource
, 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
Iam
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.
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
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
).
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
.