@aws-cdk_aws-redshift-alpha.User

class User (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Redshift.Alpha.User
Gogithub.com/aws/aws-cdk-go/awscdkredshiftalpha/v2#User
Javasoftware.amazon.awscdk.services.redshift.alpha.User
Pythonaws_cdk.aws_redshift_alpha.User
TypeScript (source)@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

  • scope Construct
  • id string
  • props UserProps

Construct Props

NameTypeDescription
cluster๐Ÿ”นIClusterThe cluster containing the database.
databaseName๐Ÿ”นstringThe name of the database.
adminUser?๐Ÿ”นISecretThe secret containing credentials to a Redshift user with administrator privileges.
encryptionKey?๐Ÿ”นIKeyKMS key to encrypt the generated secret.
removalPolicy?๐Ÿ”นRemovalPolicyThe policy to apply when this resource is removed from the application.
username?๐Ÿ”นstringThe 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.


removalPolicy?๐Ÿ”น

Type: RemovalPolicy (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

NameTypeDescription
cluster๐Ÿ”นIClusterThe cluster where the table is located.
databaseName๐Ÿ”นstringThe name of the database where the table is located.
databaseProps๐Ÿ”นDatabaseOptions
node๐Ÿ”นNodeThe tree node.
password๐Ÿ”นSecretValueThe password of the user.
secret๐Ÿ”นISecretThe Secrets Manager secret of the user.
username๐Ÿ”นstringThe 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: DatabaseOptions


node๐Ÿ”น

Type: Node

The tree node.


password๐Ÿ”น

Type: SecretValue

The password of the user.


secret๐Ÿ”น

Type: ISecret

The Secrets Manager secret of the user.


username๐Ÿ”น

Type: string

The name of the user.

Methods

NameDescription
addTablePrivileges(table, ...actions)๐Ÿ”นGrant this user privilege to access a table.
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromUserAttributes(scope, id, attrs)๐Ÿ”นSpecify a Redshift user using credentials that already exist.

addTablePrivileges(table, ...actions)๐Ÿ”น

public addTablePrivileges(table: ITable, ...actions: TableAction[]): void

Parameters

  • table ITable
  • actions TableAction

Grant this user privilege to access a table.


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 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 UserAttributes

Returns

  • IUser

Specify a Redshift user using credentials that already exist.