Get Started Free
course: Confluent Cloud Networking

Hands On: Configuring a VPC Peered Cluster

14 min
dennis-wittekind

Dennis Wittekind

Customer Success Technical Architect (Presenter)

Configuring a VPC Peered Cluster

Prerequisites:

  • AWS login

    • Permissions to create VPCs
    • Permissions to create EC2 instances
    • Permission to accept Peerings
  • Confluent Cloud Login

  • Confluent Cloud CLI

Launch a Confluent Cloud Network.

  1. Log in to Confluent Cloud, and navigate to the Cloud-Networking environment.

confluent-cloud-networking-confluent-cloud-environments

  1. Click Network Management -> Create your first network.

confluent-cloud-networking-cloud-networking-network-management

  1. Select AWS, and the cloud provider region where you created your VPC (us-east-2 in this example).

confluent-cloud-networking-create-network-1

  1. Select VPC Peering, and leave the AZs as is. Enter a CIDR for Confluent Cloud to use. It must not conflict with the VPC CIDR range you just created.

confluent-cloud-networking-create-network-2

  1. Give the network a name, and click Create Network.

confluent-cloud-networking-create-network-3

  1. The network provisioning will take a few minutes to complete.

confluent-cloud-networking-cloud-networking-mangement

  1. Once the network is ready, create a peering.

confluent-cloud-networking-create-a-peering

confluent-cloud-networking-add-vpc-peering

  1. Complete the details using the VPC that you created earlier.

confluent-cloud-networking-add-vpc-peering-connection

confluent-cloud-networking-peering-overview

  1. Back in the AWS console, accept the peering.

confluent-cloud-networking-aws-vpc-wizard

confluent-cloud-networking-aws-peering-connections

  1. Then edit the route tables to establish connectivity, click add route, set the destination as the Confluent Cloud CIDR used during creation of the network, and the target as the Peering Connection ID for which you accepted the peering.

confluent-cloud-networking-aws-edit-routes

  1. Once saved, the peering connection should show as “Ready” in the Confluent Cloud UI.

confluent-cloud-networking-peering-ready

  1. Next, create a cluster by selecting the clusters tab, and add cluster.

confluent-cloud-networking-add-cluster-peering

  1. Complete the cluster creation wizard using the defaults, and then click Launch Cluster.

confluent-cloud-networking-vpc-peered-cluster

Now that the cluster is provisioned, configure UI access and try some produce/consume operations.

confluent-cloud-networking-vpc-peered-cluster-live

confluent-cloud-networking-vpc-peered-cluster-dashboard

  1. Next, log into the instance and configure nginx per the documentation.

confluent-cloud-networking-nginx

  1. After you’ve installed nginx, you can configure it to route traffic to allow for UI access, using the hostname provided in the error message in the Confluent Cloud UI.

confluent-cloud-networking-nginx-config-1

confluent-cloud-networking-nginx-config-2

  1. Now, modify your local host file to simulate updating a DNS record to point to the HAProxy instance’s IP address.

confluent-cloud-networking-modify-your-local-host-file

  1. You can also add a security group rule to allow HTTPS traffic for the UI.

confluent-cloud-networking-edit-inbound-rules

  1. Once the security group is added, the error message should disappear, and you should be able to create topics!

confluent-cloud-networking-vpc-peered-topic

To test some production and consumption, as before, create a datagen connector to produce some data to your topic.

  1. Create the connector with defaults like in the previous exercise.

confluent-cloud-networking-create-the-connector

  1. Back on your EC2 instance, consume the topic data!

confluent-cloud-networking-consume-topic-data

Note that you won’t be able to produce/consume from your local machine, since it's not part of the VPC.

Clean up.

  1. Delete the Datagen connector.

confluent-cloud-networking-delete-datagen-connector

  1. Delete the API keys.

confluent-cloud-networking-delete-api-key-deletion

  1. Delete the cluster.

confluent-cloud-networking-delete-cluster-confirmation

  1. Delete the peering connection to AWS.

confluent-cloud-networking-delete-peering-connection-to-aws-1

confluent-cloud-networking-delete-peering-connection-to-aws-2

  1. Delete the Network.

confluent-cloud-networking-delete-the-network

  1. Revert your host file back to the previous state.

Use the promo code NETWORKING101 to get $25 of free Confluent Cloud usage

Be the first to get updates and new content

We will only share developer content and updates, including notifications when new content is added. We will never send you sales emails. 🙂 By subscribing, you understand we will process your personal information in accordance with our Privacy Statement.