Step 3: Create a client machine - 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).

Step 3: 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. Enter a Name for your client machine, such as MSKTutorialClient.

  4. Leave Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type selected for Amazon Machine Image (AMI) type.

  5. Leave the t2.micro instance type selected.

  6. Under Key pair (login), 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.

  7. Expand the Advanced details section and choose the IAM role that you created in Step 2: Create an IAM role.

  8. Choose Launch instance.

  9. Choose View Instances. Then, in the Security Groups column, choose the security group that is associated with your new instance. Copy the ID of the security group, and save it for later.

  10. Open the Amazon VPC console at

  11. In the navigation pane, choose Security Groups. Find the security group whose ID you saved in Step 1: Create an Amazon MSK cluster.

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

  13. Choose Add rule.

  14. In the new rule, choose All traffic in the Type column. In the second field in the Source column, select the security group of your client machine. This is the group whose name you saved after you launched the client machine instance.

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

Next Step

Step 4: Create a topic