I am a kafka newbie. I've to list the topics in the MSK(https://console.aws.amazon.com/msk/home) . I login to msk but there is no console there to run the relevant commands to list the topics. So I am trying to figure out on which EC2 is the MSK running so I can log in that machine. But I've not been able to figure out how to map the relevant EC2 instance to my current running MSK.
MSK is a managed service, which means Amazon manages the servers for you. You don't get access to the underlying servers of managed services on Amazon. If they even use EC2 instances behind the scenes (they probably do) those EC2 servers won't be visible to you.
To list the topics on your MSK cluster, you would need to do something like this from an EC2 server in the same VPC:
bin/kafka-topics.sh --list --zookeeper <zookeeper endpoint>
Where <zookeeper endpoint>
is the ZooKeeper endpoint of your MSK cluster.
See the official documentation on this subject here.