Cluster

class aws_cdk.aws_redshift.Cluster(scope, id, *, master_user, vpc, cluster_name=None, cluster_type=None, default_database_name=None, encrypted=None, encryption_key=None, logging_bucket=None, logging_key_prefix=None, node_type=None, number_of_nodes=None, parameter_group=None, port=None, preferred_maintenance_window=None, removal_policy=None, roles=None, security_groups=None, vpc_subnets=None)

Bases: aws_cdk.core.Resource

Create a Redshift cluster a given number of nodes.

stability :stability: experimental resource: :resource:: AWS::Redshift::Cluster

__init__(scope, id, *, master_user, vpc, cluster_name=None, cluster_type=None, default_database_name=None, encrypted=None, encryption_key=None, logging_bucket=None, logging_key_prefix=None, node_type=None, number_of_nodes=None, parameter_group=None, port=None, preferred_maintenance_window=None, removal_policy=None, roles=None, security_groups=None, vpc_subnets=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • master_user (Login) – Username and password for the administrative user.

  • vpc (IVpc) – The VPC to place the cluster in.

  • cluster_name (Optional[str]) – An optional identifier for the cluster. Default: - A name is automatically generated.

  • cluster_type (Optional[ClusterType]) – Settings for the individual instances that are launched. Default: {@link ClusterType.MULTI_NODE}

  • default_database_name (Optional[str]) – Name of a database which is automatically created inside the cluster. Default: - default_db

  • encrypted (Optional[bool]) – Whether to enable encryption of data at rest in the cluster. Default: true

  • encryption_key (Optional[IKey]) – The KMS key to use for encryption of data at rest. Default: - AWS-managed key, if encryption at rest is enabled

  • logging_bucket (Optional[IBucket]) – Bucket to send logs to. Logging information includes queries and connection attempts, for the specified Amazon Redshift cluster. Default: - No Logs

  • logging_key_prefix (Optional[str]) – Prefix used for logging. Default: - no prefix

  • node_type (Optional[NodeType]) – The node type to be provisioned for the cluster. Default: {@link NodeType.DC2_LARGE}

  • number_of_nodes (Union[int, float, None]) – Number of compute nodes in the cluster. Only specify this property for multi-node clusters. Value must be at least 2 and no more than 100. Default: - 2 if clusterType is ClusterType.MULTI_NODE, undefined otherwise

  • parameter_group (Optional[IClusterParameterGroup]) – Additional parameters to pass to the database engine https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html. Default: - No parameter group.

  • port (Union[int, float, None]) – What port to listen on. Default: - The default for the engine is used.

  • preferred_maintenance_window (Optional[str]) – A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). Example: ‘Sun:23:45-Mon:00:15’ Default: - 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week.

  • removal_policy (Optional[RemovalPolicy]) – The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. Default: RemovalPolicy.RETAIN

  • roles (Optional[List[IRole]]) – A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services. Specify a maximum of 10 roles. Default: - No role is attached to the cluster.

  • security_groups (Optional[List[ISecurityGroup]]) – Security group. Default: a new security group is created.

  • vpc_subnets (Optional[SubnetSelection]) – Where to place the instances within the VPC. Default: private subnets

stability :stability: experimental

Return type

None

Methods

add_rotation_multi_user(id, *, secret, automatically_after=None)

Adds the multi user rotation to this cluster.

Parameters
  • id (str) –

  • secret (ISecret) – The secret to rotate. It must be a JSON string with the following format:: { “engine”: <required: database engine>, “host”: <required: instance host name>, “username”: <required: username>, “password”: <required: password>, “dbname”: <optional: database name>, “port”: <optional: if not specified, default port will be used>, “masterarn”: <required: the arn of the master secret which will be used to create users/change passwords> }

  • automatically_after (Optional[Duration]) – Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. Default: Duration.days(30)

stability :stability: experimental

Return type

SecretRotation

add_rotation_single_user(automatically_after=None)

Adds the single user rotation of the master password to this cluster.

Parameters

automatically_after (Optional[Duration]) – Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

stability :stability: experimental

Return type

SecretRotation

as_secret_attachment_target()

Renders the secret attachment target specifications.

stability :stability: experimental

Return type

SecretAttachmentTargetProps

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

cluster_endpoint

The endpoint to use for read/write operations.

stability :stability: experimental

Return type

Endpoint

cluster_name

Identifier of the cluster.

stability :stability: experimental

Return type

str

connections

Access to the network connections.

stability :stability: experimental

Return type

Connections

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

secret

The secret attached to this cluster.

stability :stability: experimental

Return type

Optional[ISecret]

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_cluster_attributes(scope, id, *, cluster_endpoint_address, cluster_endpoint_port, cluster_name, security_groups=None)

Import an existing DatabaseCluster from properties.

Parameters
  • scope (Construct) –

  • id (str) –

  • cluster_endpoint_address (str) – Cluster endpoint address.

  • cluster_endpoint_port (Union[int, float]) – Cluster endpoint port.

  • cluster_name (str) – Identifier for the cluster.

  • security_groups (Optional[List[ISecurityGroup]]) – The security groups of the redshift cluster. Default: no security groups will be attached to the import

stability :stability: experimental

Return type

ICluster

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool