Step 2: Create a client machine - Amazon Managed Streaming for Apache Kafka

Step 2: Create a client machine

In this step of Getting Started Using Amazon MSK, you create a client machine. You use this client machine to create a topic that produces and consumes data. For simplicity, you'll create this client machine in the VPC that is associated with the MSK cluster so that the client can easily connect to the cluster.

To create a client machine

  1. Open the Amazon EC2 console at

  2. Choose Launch instances.

  3. Choose Select to create an instance of Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type.

  4. Choose the t2.xlarge instance type by selecting the check box next to it.

  5. Choose Next: Configure Instance Details.

  6. In the Network list, choose the VPC whose ID you saved in Step 1: Create an Amazon MSK Cluster.

  7. In the Auto-assign Public IP list, choose Enable.

  8. In the menu near the top, choose Add Tags.

  9. Choose Add Tag.

  10. Enter Name for the Key and MSKTutorialClient for the Value.

  11. Choose Review and Launch, and then choose Launch.

  12. Choose Create a new key pair, enter MSKKeyPair for Key pair name, and then choose Download Key Pair. Alternatively, you can use an existing key pair if you prefer.

  13. Read the acknowledgement, select the check box next to it, and choose Launch Instances.

  14. Choose View Instances. Then, in the Security Groups column, choose the security group that is associated with the MSKTutorialClient instance.

  15. Copy the name of the security group, and save it for later.

  16. Open the Amazon VPC console at

  17. In the navigation pane, choose Security Groups. Find the security group whose ID you saved in Step 1: Create an Amazon MSK Cluster. Choose this row by selecting the check box in the first column.

  18. In the Inbound Rules tab, choose Edit inbound rules.

  19. Choose Add rule.

  20. In the new rule, choose All traffic in the Type column. In the second field in the Source column, select the security group of the client machine. This is the group whose name you saved earlier in this step.

  21. Choose Save rules. Now the cluster's security group can accept traffic that comes from the client machine's security group.

Next Step

Step 3: Create a topic