UserAttributes

class aws_cdk.aws_redshift.UserAttributes(*, cluster, database_name, admin_user=None, password, username)

Bases: DatabaseOptions

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

Parameters:
  • cluster (ICluster) – (experimental) The cluster containing the database.

  • database_name (str) – (experimental) The name of the database.

  • admin_user (Optional[ISecret]) – (experimental) The secret containing credentials to a Redshift user with administrator privileges. Secret JSON schema: { username: string; password: string }. Default: - the admin secret is taken from the cluster

  • password (SecretValue) – (experimental) The password of the user. Do not put passwords in CDK code directly.

  • username (str) – (experimental) The name of the user.

Stability:

experimental

ExampleMetadata:

fixture=cluster infused

Example:

database_name = "databaseName"
username = "myuser"
table_name = "mytable"

user = User.from_user_attributes(self, "User",
    username=username,
    password=SecretValue.unsafe_plain_text("NOT_FOR_PRODUCTION"),
    cluster=cluster,
    database_name=database_name
)
table = Table.from_table_attributes(self, "Table",
    table_name=table_name,
    table_columns=[Column(name="col1", data_type="varchar(4)"), Column(name="col2", data_type="float")],
    cluster=cluster,
    database_name="databaseName"
)
table.grant(user, TableAction.INSERT)

Attributes

admin_user

(experimental) The secret containing credentials to a Redshift user with administrator privileges.

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

Default:
  • the admin secret is taken from the cluster

Stability:

experimental

cluster

(experimental) The cluster containing the database.

Stability:

experimental

database_name

(experimental) The name of the database.

Stability:

experimental

password

(experimental) The password of the user.

Do not put passwords in CDK code directly.

Stability:

experimental

username

(experimental) The name of the user.

Stability:

experimental