ClusterProps

class aws_cdk.aws_msk.ClusterProps(*, cluster_name, kafka_version, vpc, client_authentication=None, configuration_info=None, ebs_storage_info=None, encryption_in_transit=None, instance_type=None, logging=None, monitoring=None, number_of_broker_nodes=None, removal_policy=None, security_groups=None, vpc_subnets=None)

Bases: object

(experimental) Properties for a MSK Cluster.

Parameters
  • cluster_name (str) – (experimental) The physical name of the cluster.

  • kafka_version (KafkaVersion) – (experimental) The version of Apache Kafka.

  • vpc (IVpc) – (experimental) Defines the virtual networking environment for this cluster. Must have at least 2 subnets in two different AZs.

  • client_authentication (Optional[ClientAuthentication]) – (experimental) Configuration properties for client authentication. MSK supports using private TLS certificates or SASL/SCRAM to authenticate the identity of clients. Default: - disabled

  • configuration_info (Optional[ClusterConfigurationInfo]) – (experimental) The Amazon MSK configuration to use for the cluster. Default: - none

  • ebs_storage_info (Optional[EbsStorageInfo]) – (experimental) Information about storage volumes attached to MSK broker nodes. Default: - 1000 GiB EBS volume

  • encryption_in_transit (Optional[EncryptionInTransitConfig]) – (experimental) Config details for encryption in transit. Default: - enabled

  • instance_type (Optional[InstanceType]) – (experimental) The EC2 instance type that you want Amazon MSK to use when it creates your brokers. Default: kafka.m5.large

  • logging (Optional[BrokerLogging]) – (experimental) Configure your MSK cluster to send broker logs to different destination types. Default: - disabled

  • monitoring (Optional[MonitoringConfiguration]) – (experimental) Cluster monitoring configuration. Default: - DEFAULT monitoring level

  • number_of_broker_nodes (Union[int, float, None]) – (experimental) Number of Apache Kafka brokers deployed in each Availability Zone. Default: 1

  • removal_policy (Optional[RemovalPolicy]) – (experimental) What to do when this resource is deleted from a stack. Default: RemovalPolicy.RETAIN

  • security_groups (Optional[Sequence[ISecurityGroup]]) – (experimental) The AWS security groups to associate with the elastic network interfaces in order to specify who can connect to and communicate with the Amazon MSK cluster. Default: - create new security group

  • vpc_subnets (Optional[SubnetSelection]) – (experimental) Where to place the nodes within the VPC. Amazon MSK distributes the broker nodes evenly across the subnets that you specify. The subnets that you specify must be in distinct Availability Zones. Client subnets can’t be in Availability Zone us-east-1e. Default: - the Vpc default strategy if not specified.

Stability

experimental

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_msk as msk
import aws_cdk.aws_ec2 as ec2

cluster = msk.Cluster(self, "Cluster", ...)

cluster.connections.allow_from(
    ec2.Peer.ipv4("1.2.3.4/8"),
    ec2.Port.tcp(2181))
cluster.connections.allow_from(
    ec2.Peer.ipv4("1.2.3.4/8"),
    ec2.Port.tcp(9094))

Attributes

client_authentication

(experimental) Configuration properties for client authentication.

MSK supports using private TLS certificates or SASL/SCRAM to authenticate the identity of clients.

Default
  • disabled

Stability

experimental

Return type

Optional[ClientAuthentication]

cluster_name

(experimental) The physical name of the cluster.

Stability

experimental

Return type

str

configuration_info

(experimental) The Amazon MSK configuration to use for the cluster.

Default
  • none

Stability

experimental

Return type

Optional[ClusterConfigurationInfo]

ebs_storage_info

(experimental) Information about storage volumes attached to MSK broker nodes.

Default
  • 1000 GiB EBS volume

Stability

experimental

Return type

Optional[EbsStorageInfo]

encryption_in_transit

(experimental) Config details for encryption in transit.

Default
  • enabled

Stability

experimental

Return type

Optional[EncryptionInTransitConfig]

instance_type

(experimental) The EC2 instance type that you want Amazon MSK to use when it creates your brokers.

Default

kafka.m5.large

See

https://docs.aws.amazon.com/msk/latest/developerguide/msk-create-cluster.html#broker-instance-types

Stability

experimental

Return type

Optional[InstanceType]

kafka_version

(experimental) The version of Apache Kafka.

Stability

experimental

Return type

KafkaVersion

logging

(experimental) Configure your MSK cluster to send broker logs to different destination types.

Default
  • disabled

Stability

experimental

Return type

Optional[BrokerLogging]

monitoring

(experimental) Cluster monitoring configuration.

Default
  • DEFAULT monitoring level

Stability

experimental

Return type

Optional[MonitoringConfiguration]

number_of_broker_nodes

(experimental) Number of Apache Kafka brokers deployed in each Availability Zone.

Default

1

Stability

experimental

Return type

Union[int, float, None]

removal_policy

(experimental) What to do when this resource is deleted from a stack.

Default

RemovalPolicy.RETAIN

Stability

experimental

Return type

Optional[RemovalPolicy]

security_groups

(experimental) The AWS security groups to associate with the elastic network interfaces in order to specify who can connect to and communicate with the Amazon MSK cluster.

Default
  • create new security group

Stability

experimental

Return type

Optional[List[ISecurityGroup]]

vpc

(experimental) Defines the virtual networking environment for this cluster.

Must have at least 2 subnets in two different AZs.

Stability

experimental

Return type

IVpc

vpc_subnets

(experimental) Where to place the nodes within the VPC.

Amazon MSK distributes the broker nodes evenly across the subnets that you specify. The subnets that you specify must be in distinct Availability Zones. Client subnets can’t be in Availability Zone us-east-1e.

Default
  • the Vpc default strategy if not specified.

Stability

experimental

Return type

Optional[SubnetSelection]