class User (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Redshift.Alpha.User |
![]() | github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2#User |
![]() | software.amazon.awscdk.services.redshift.alpha.User |
![]() | aws_cdk.aws_redshift_alpha.User |
![]() | @aws-cdk/aws-redshift-alpha ยป User |
Implements
IConstruct
, IDependable
, IUser
A user in a Redshift cluster.
Example
const user = new User(this, 'User', {
cluster: cluster,
databaseName: 'databaseName',
});
cluster.addRotationMultiUser('MultiUserRotation', {
secret: user.secret,
});
Initializer
new User(scope: Construct, id: string, props: UserProps)
Parameters
Construct Props
Name | Type | Description |
---|---|---|
cluster | ICluster | The cluster containing the database. |
database | string | The name of the database. |
admin | ISecret | The secret containing credentials to a Redshift user with administrator privileges. |
encryption | IKey | KMS key to encrypt the generated secret. |
exclude | string | Characters to not include in the generated password. |
removal | Removal | The policy to apply when this resource is removed from the application. |
username? | string | The name of the user. |
cluster
Type:
ICluster
The cluster containing the database.
databaseName
Type:
string
The name of the database.
adminUser?
Type:
ISecret
(optional, default: the admin secret is taken from the cluster)
The secret containing credentials to a Redshift user with administrator privileges.
Secret JSON schema: { username: string; password: string }
.
encryptionKey?
Type:
IKey
(optional, default: the default AWS managed key is used)
KMS key to encrypt the generated secret.
excludeCharacters?
Type:
string
(optional, default: '"@/\\ '')
Characters to not include in the generated password.
removalPolicy?
Type:
Removal
(optional, default: cdk.RemovalPolicy.Destroy)
The policy to apply when this resource is removed from the application.
username?
Type:
string
(optional, default: a name is generated)
The name of the user.
For valid values, see: https://docs.aws.amazon.com/redshift/latest/dg/r_names.html
Properties
Name | Type | Description |
---|---|---|
cluster | ICluster | The cluster where the table is located. |
database | string | The name of the database where the table is located. |
database | Database | |
node | Node | The tree node. |
password | Secret | The password of the user. |
secret | ISecret | The Secrets Manager secret of the user. |
username | string | The name of the user. |
cluster
Type:
ICluster
The cluster where the table is located.
databaseName
Type:
string
The name of the database where the table is located.
databaseProps
Type:
Database
node
Type:
Node
The tree node.
password
Type:
Secret
The password of the user.
secret
Type:
ISecret
The Secrets Manager secret of the user.
username
Type:
string
The name of the user.
Methods
Name | Description |
---|---|
add | Grant this user privilege to access a table. |
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Specify a Redshift user using credentials that already exist. |
addTablePrivileges(table, ...actions)
public addTablePrivileges(table: ITable, ...actions: TableAction[]): void
Parameters
- table
ITable
- actions
Table
Action
Grant this user privilege to access a table.
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 destroyed (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
This resource is destroyed by default.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromUserAttributes(scope, id, attrs)
public static fromUserAttributes(scope: Construct, id: string, attrs: UserAttributes): IUser
Parameters
- scope
Construct
- id
string
- attrs
User
Attributes
Returns
Specify a Redshift user using credentials that already exist.