Getting the bootstrap brokers for an Amazon MSK cluster - Amazon Managed Streaming for Apache Kafka
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Getting the bootstrap brokers for an Amazon MSK cluster

Getting the bootstrap brokers using the Amazon Web Services Management Console

The term bootstrap brokers refers to a list of brokers that an Apache Kafka client can use as a starting point to connect to the cluster. This list doesn't necessarily include all of the brokers in a cluster.

  1. Open the Amazon MSK console at

  2. The table shows all the clusters for the current region under this account. Choose the name of a cluster to view its description.

  3. On the Cluster summary page, choose View client information. This shows you the bootstrap brokers, as well as the Apache ZooKeeper connection string.

Getting the bootstrap brokers using the Amazon CLI

Run the following command, replacing ClusterArn with the Amazon Resource Name (ARN) that you obtained when you created your cluster. If you don't have the ARN for your cluster, you can find it by listing all clusters. For more information, see Listing Amazon MSK clusters.

aws kafka get-bootstrap-brokers --cluster-arn ClusterArn

For an MSK cluster that uses IAM access control, the output of this command looks like the following JSON example.

{ "BootstrapBrokerStringSaslIam": "," }

The following example shows the bootstrap brokers for a cluster that has public access turned on. Use the BootstrapBrokerStringPublicSaslIam for public access, and the BootstrapBrokerStringSaslIam string for access from within Amazon.

{ "BootstrapBrokerStringPublicSaslIam": ",,", "BootstrapBrokerStringSaslIam": ",," }

The bootstrap brokers string should contain three brokers from across the Availability Zones in which your MSK cluster is deployed (unless only two brokers are available).

Getting the bootstrap brokers using the API

To get the bootstrap brokers using the API, see GetBootstrapBrokers.