Skip to content
v2.274.0

Experimental

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

ClusterProps Struct ​

Properties for a MSK Cluster.

Example ​

ts
declare const vpc: ec2.Vpc;
const cluster = new msk.Cluster(this, 'cluster', {
  clusterName: 'myCluster',
  kafkaVersion: msk.KafkaVersion.V4_1_X_KRAFT,
  vpc,
  encryptionInTransit: {
    clientBroker: msk.ClientBrokerEncryption.TLS,
  },
  clientAuthentication: msk.ClientAuthentication.sasl({
    scram: true,
  }),
});

Properties ​

brokerTypeBrokerTypebroker_typeBrokerTypebrokerTypeBrokerTypeBrokerTypeBrokerTypeBrokerTypeBrokerType= BrokerType.STANDARD#
The broker type for the cluster.

When set to EXPRESS, the cluster will be created with Express Brokers. When this is set to EXPRESS, instanceType must also be specified.

clientAuthenticationClientAuthenticationclient_authenticationClientAuthenticationclientAuthenticationClientAuthenticationClientAuthenticationClientAuthenticationClientAuthenticationClientAuthentication= disabled#
Configuration properties for client authentication.

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

clusterNamestringcluster_namestrclusterNameStringClusterNamestringClusterName*stringrequired#
The physical name of the cluster.
configurationInfoClusterConfigurationInfoconfiguration_infoClusterConfigurationInfoconfigurationInfoClusterConfigurationInfoConfigurationInfoClusterConfigurationInfoConfigurationInfoClusterConfigurationInfo= none#
The Amazon MSK configuration to use for the cluster.
ebsStorageInfoEbsStorageInfoebs_storage_infoEbsStorageInfoebsStorageInfoEbsStorageInfoEbsStorageInfoEbsStorageInfoEbsStorageInfoEbsStorageInfo#
Information about storage volumes attached to MSK broker nodes.

Default: 1000 GiB EBS volume

encryptionInTransitEncryptionInTransitConfigencryption_in_transitEncryptionInTransitConfigencryptionInTransitEncryptionInTransitConfigEncryptionInTransitEncryptionInTransitConfigEncryptionInTransitEncryptionInTransitConfig= enabled#
Config details for encryption in transit.
instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceType= kafka.m5.large#
The EC2 instance type that you want Amazon MSK to use when it creates your brokers.
kafkaVersionKafkaVersionkafka_versionKafkaVersionkafkaVersionKafkaVersionKafkaVersionKafkaVersionKafkaVersionKafkaVersionrequired#
The version of Apache Kafka.
loggingBrokerLoggingloggingBrokerLoggingloggingBrokerLoggingLoggingBrokerLoggingLoggingBrokerLogging= disabled#
Configure your MSK cluster to send broker logs to different destination types.
Cluster monitoring configuration.

Default: DEFAULT monitoring level

numberOfBrokerNodesnumbernumber_of_broker_nodesint | floatnumberOfBrokerNodesNumberNumberOfBrokerNodesdoubleNumberOfBrokerNodes*float64= 1#
Number of Apache Kafka brokers deployed in each Availability Zone.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#
What to do when this resource is deleted from a stack.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup#
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

storageModeStorageModestorage_modeStorageModestorageModeStorageModeStorageModeStorageModeStorageModeStorageMode= StorageMode.LOCAL#
This controls storage mode for supported storage tiers.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
Defines the virtual networking environment for this cluster.

Must have at least 2 subnets in two different AZs.

vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection#
Where to place the nodes within the VPC.

Default: the Vpc default strategy if not specified.

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.