User

class aws_cdk.aws_redshift.User(scope, id, *, encryption_key=None, removal_policy=None, username=None, cluster, database_name, admin_user=None)

Bases: aws_cdk.core.Construct

(experimental) A user in a Redshift cluster.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • encryption_key (Optional[IKey]) – (experimental) KMS key to encrypt the generated secret. Default: - the default AWS managed key is used

  • removal_policy (Optional[RemovalPolicy]) – (experimental) The policy to apply when this resource is removed from the application. Default: cdk.RemovalPolicy.Destroy

  • username (Optional[str]) – (experimental) The name of the user. For valid values, see: https://docs.aws.amazon.com/redshift/latest/dg/r_names.html Default: - a name is generated

  • 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

Stability

experimental

Methods

add_table_privileges(table, *actions)

(experimental) Grant this user privilege to access a table.

Parameters
Stability

experimental

Return type

None

apply_removal_policy(policy)

(experimental) 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.

Parameters

policy (RemovalPolicy) –

Stability

experimental

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

cluster

(experimental) The cluster where the table is located.

Stability

experimental

Return type

ICluster

database_name

(experimental) The name of the database where the table is located.

Stability

experimental

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

password

(experimental) The password of the user.

Stability

experimental

Return type

SecretValue

username

(experimental) The name of the user.

Stability

experimental

Return type

str

Static Methods

classmethod from_user_attributes(scope, id, *, password, username, cluster, database_name, admin_user=None)

(experimental) Specify a Redshift user using credentials that already exist.

Parameters
  • scope (Construct) –

  • id (str) –

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

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

  • 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

Stability

experimental

Return type

IUser

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool