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 https://console.aws.amazon.com/ec2/.

  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. Choose Launch instance.

  8. 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.

  9. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

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

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

  12. Choose Add rule.

  13. 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.

  14. 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