Skip to content
v2.273.0

Experimental

@aws-cdk/aws-redshift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

UserAttributes Struct ​

A full specification of a Redshift user that can be used to import it fluently into the CDK application.

Example ​

ts
const databaseName = 'databaseName';
const username = 'myuser'
const tableName = 'mytable'

const user = User.fromUserAttributes(this, 'User', {
  username: username,
  password: SecretValue.unsafePlainText('NOT_FOR_PRODUCTION'),
  cluster: cluster,
  databaseName: databaseName,
});
const table = Table.fromTableAttributes(this, 'Table', {
  tableName: tableName,
  tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],
  cluster: cluster,
  databaseName: 'databaseName',
});
table.grant(user, TableAction.INSERT);

Properties ​

adminUserISecretadmin_userISecretadminUserISecretAdminUserISecretAdminUserISecret= the admin secret is taken from t…#
The secret containing credentials to a Redshift user with administrator privileges.

Secret JSON schema: { username: string; password: string }.

default

Default: the admin secret is taken from the cluster

clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The cluster containing the database.
databaseNamestringdatabase_namestrdatabaseNameStringDatabaseNamestringDatabaseName*stringrequired#
The name of the database.
passwordSecretValuepasswordSecretValuepasswordSecretValuePasswordSecretValuePasswordSecretValuerequired#
The password of the user.

Do not put passwords in CDK code directly.

usernamestringusernamestrusernameStringUsernamestringUsername*stringrequired#
The name of the user.