Skip to content

MSK (Kafka)

CloudMock emulates Amazon MSK, supporting cluster management, broker operations, configurations, cluster operations tracking, and tagging.

OperationStatusNotes
CreateClusterSupportedCreates an MSK cluster
DescribeClusterSupportedReturns cluster details
ListClustersSupportedLists all clusters
DeleteClusterSupportedDeletes a cluster
UpdateBrokerCountSupportedScales the number of brokers
UpdateBrokerStorageSupportedUpdates broker storage
UpdateClusterConfigurationSupportedUpdates cluster configuration
RebootBrokerSupportedReboots a broker
GetBootstrapBrokersSupportedReturns bootstrap broker connection strings
ListNodesSupportedLists broker nodes
CreateConfigurationSupportedCreates a configuration
DescribeConfigurationSupportedReturns configuration details
ListConfigurationsSupportedLists configurations
UpdateConfigurationSupportedUpdates a configuration
DeleteConfigurationSupportedDeletes a configuration
ListClusterOperationsSupportedLists cluster operations
DescribeClusterOperationSupportedReturns operation details
TagResourceSupportedAdds tags to a resource
UntagResourceSupportedRemoves tags from a resource
ListTagsForResourceSupportedLists tags for a resource
import { KafkaClient, CreateClusterCommand } from '@aws-sdk/client-kafka';
const client = new KafkaClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { ClusterArn } = await client.send(new CreateClusterCommand({
ClusterName: 'my-kafka-cluster',
KafkaVersion: '3.5.1',
NumberOfBrokerNodes: 3,
BrokerNodeGroupInfo: {
InstanceType: 'kafka.m5.large',
ClientSubnets: ['subnet-1', 'subnet-2', 'subnet-3'],
},
}));
console.log(ClusterArn);
import boto3
client = boto3.client('kafka',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.create_cluster(
ClusterName='my-kafka-cluster',
KafkaVersion='3.5.1',
NumberOfBrokerNodes=3,
BrokerNodeGroupInfo={
'InstanceType': 'kafka.m5.large',
'ClientSubnets': ['subnet-1', 'subnet-2', 'subnet-3'],
})
print(response['ClusterArn'])
cloudmock.yml
services:
kafka:
enabled: true
  • No actual Kafka brokers are provisioned
  • Bootstrap broker strings are placeholders
  • Broker reboots and scaling are status changes only