CLOUD
Follow this procedure to configure AWS PrivateLink for a Dedicated cluster in AWS.
Warning
For limitations of the AWS PrivateLink feature, see Limitations.
To make an AWS PrivateLink connection to a cluster in Confluent Cloud you must register the AWS account ID you wish to use. This is a security measure so Confluent can ensure only your organization can initiate AWS PrivateLink connections to the cluster. AWS PrivateLink connections from a VPC not contained in a registered AWS account will not be accepted by Confluent Cloud.
After the connection status is “Active” in the Confluent Cloud web UI, you must configure VPC Endpoint(s) in your VPC to make the PrivateLink connection(s) to your Confluent Cloud cluster.
Note
Confluent recommends using a Terraform config for setting up the VPC Endpoint. This config automates the manual steps described below.
In the Confluent Cloud UI you will find the following information for your Confluent Cloud cluster under the Cluster Settings section.
Verify subnet availability
The Confluent Cloud VPC and cluster is created in specific zone(s) that, for optimal usage, should match the zone(s) of the customer VPC you want to make the AWS PrivateLink connection(s) from. You must have subnet(s) in your VPC for these zone(s) so that IP(s) can be allocated from them. It is allowed to also have subnets in zones outside of these. AWS Zone IDs should be used for this. You can find the specific Availability Zone(s) for your Confluent Cloud cluster in the UI.
Ensure the VPC settings enableDnsHostnames and enableDnsSupport are set to true.
true
Please note: Availability Zone names (like us-west-2a) are not consistent across AWS accounts, so Availability Zone IDs (like usw2-az1) are used instead.
Create the VPC Endpoint
In the AWS VPC Console:
Select Endpoints from left hand list of tabs.
Click Create Endpoint.
Select Find service by name.
Paste in the Confluent Cloud VPC Service Endpoint Name. You can find this in the Confluent Cloud UI.
Click Verify. If you get an error, ensure that your account is allowed to create PrivateLink connections.
Select VPC to create endpoints. Keep a note of this VPC Endpoint ID for use later.
Note the availability zone(s) for your Confluent Cloud cluster from the Networking tab in the Confluent Cloud UI. Select the service in these zone(s). Ensure the desired subnet is selected for each zone. Failure to add all zone(s) as displayed in the Confluent Cloud UI can cause connectivity issues to brokers in the omitted zones, which can result in an unusable cluster.
Confluent Cloud single availability zone clusters will need service and subnet selection in one zone whereas Confluent Cloud multi availability zone clusters will need service and subnet selection in three zones.
Select or create a security group for the VPC Endpoints. Add three inbound rules for each of ports 80, 443, and 9092 from your desired source (i.e. your VPC CIDR). The Protocol should be TCP for all three rules. Note: port 80 is not required, but is available as a redirect only to https/443 if desired.
TCP
Wait for acceptance by Confluent Cloud. This should happen almost immediately (less than 1 minute). After it is accepted, the endpoint will transition from “Pending” to “Active”.
DNS changes must be made to ensure connectivity passes through AWS PrivateLink in the supported pattern. Any DNS provider can be used - AWS Route53 (used in this example) is not required. Any DNS provider that can ensure DNS is routed as follows is acceptable.
Run the DNS helper script to figure out the DNS Zone records for a specific VPC Endpoint.
Update DNS using AWS Route53 in the AWS console:
Create the Private Hosted Zone.
Set up DNS records for Confluent Cloud single availability zone clusters as follows:
Create the following record with the Create Record Set button using the VPC Endpoint DNS Name map from the previous setup in the form
*.$domain CNAME “The lone zonal VPC Endpoint” TTL 60
For example:
*.l92v4.us-west-2.aws.confluent.cloud CNAME vpce-09f9f4e9a86682eed-9gxp2f7v-us-west-2c.vpce-svc-04689782e9d70ee9e.us-west-2.vpce.amazonaws.com TTL 60
Set up DNS records for Confluent Cloud multi availability zone clusters as follows:
Create the following records with the Create Record Set button using the VPC Endpoint DNS Name map from the previous setup in the form
*.$domain CNAME “All Zones VPC Endpoint” TTL 60
*.l92v4.us-west-2.aws.confluent.cloud CNAME vpce-09f9f4e9a86682eed-9gxp2f7v.vpce-svc-04689782e9d70ee9e.us-west-2.vpce.amazonaws.com TTL 60
The CNAME is used to ensure AWS Route53 health checks are utilized in the case of AWS outages.
Create one record per zone (repeat for all zones) in the form.
*.$zoneid.$domain CNAME “Zonal VPC Endpoint” TTL 60
*.usw2-az3.l92v4.us-west-2.aws.confluent.cloud. CNAME vpce-09f9f4e9a86682eed-9gxp2f7v-us-west-2a.vpce-svc-04689782e9d70ee9e.us-west-2.vpce.amazonaws.com TTL 60 *.usw2-az2.l92v4.us-west-2.aws.confluent.cloud. CNAME vpce-09f9f4e9a86682eed-9gxp2f7v-us-west-2c.vpce-svc-04689782e9d70ee9e.us-west-2.vpce.amazonaws.com TTL 60 *.usw2-az1.l92v4.us-west-2.aws.confluent.cloud. CNAME vpce-09f9f4e9a86682eed-9gxp2f7v-us-west-2b.vpce-svc-04689782e9d70ee9e.us-west-2.vpce.amazonaws.com TTL 60
From an instance within the VPC (or anywhere the previous step’s DNS is set up), run the following to validate Kafka connectivity through AWS PrivateLink is working correctly.
Set a variable with the cluster bootstrap URL.
% export BOOTSTRAP=$ConfluentCloudBootstrap
% export BOOTSTRAP=lkc-nkodz-0l6je.us-west-2.aws.confluent.cloud
Test connectivity to the cluster.
% openssl s_client -connect $BOOTSTRAP:9092 -servername $BOOTSTRAP -verify_hostname $BOOTSTRAP </dev/null 2>/dev/null | grep -E 'Verify return code|BEGIN CERTIFICATE' | xargs
If the return output is -----BEGIN CERTIFICATE----- Verify return code: 0 (ok), connectivity to the bootstrap is confirmed.
-----BEGIN CERTIFICATE----- Verify return code: 0 (ok)
You might need to update the network security tools and firewalls to allow connectivity. If you have issues connecting after following these steps, confirm which network security systems your organization uses and whether their configurations need to be changed. If you still have issues, run the debug connectivity script and provide the output to Confluent Cloud Support for assistance with your PrivateLink setup.
Next, verify connectivity with the Confluent Cloud CLI.
Log in to the Confluent Cloud CLI with your Confluent Cloud credentials.
ccloud login
List the clusters in your organization.
ccloud kafka cluster list
Select the cluster with AWS PrivateLink you wish to test.
ccloud kafka cluster use ...
ccloud kafka cluster use lkc-a1b2c
Create a cluster API key to authenticate with the cluster.
ccloud api-key create --resource ... --description ...
ccloud api-key create --resource lkc-a1b2c --description "connectivity test"
Select the API key you just created.
ccloud api-key use ... --resource ...
ccloud api-key use WQDMCIQWLJDGYR5Q --resource lkc-a1b2c
Create a test topic.
ccloud kafka topic create test
Start consuming events from the test topic.
ccloud kafka topic consume test
Open another terminal tab or window.
Start a producer.
ccloud kafka topic produce test
Type anything into the produce tab and hit Enter; press Ctrl+D or Ctrl+C to stop the producer.
Enter
Ctrl+D
Ctrl+C
The tab running consume will print what was typed in the tab running produce.
You’re done! The cluster is ready for use.
The following regions are not yet supported for AWS PrivateLink clusters in Confluent Cloud: eu-west-2 (London), eu-west-3 (Paris), sa-east-1 (Sao Paulo), af-south-1 (Cape Town) and me-south-1 (Bahrain). Instead, you can use VPC peering for clusters in these regions, or use AWS PrivateLink with clusters in different regions.
The following is the list of supported and unsupported availability zones in AWS us-east-1 region for AWS PrivateLink clusters in Confluent Cloud:
Cross-region AWS PrivateLink connections are not supported.
AWS PrivateLink is only available for use with Dedicated clusters.
Existing Confluent Cloud clusters cannot be converted to use AWS PrivateLink.
Fully-managed ksqlDB is not available for use with AWS PrivateLink clusters.
Fully-managed Confluent Cloud connectors can connect to source(s) or sink(s) using a public IP. Source(s) or sink(s) in the customer network with private IP are not supported.
AWS PrivateLink connections cannot be shared across multiple Confluent Cloud clusters. Separate AWS PrivateLink connections must be made to each Confluent Cloud cluster.
Availability zone selection for placement of Confluent Cloud cluster and AWS PrivateLink service is not supported.
Each Confluent Cloud multi availability zone cluster using PrivateLink will be provisioned with service endpoints in three availability zones. For those AWS regions that have more than three availability zones, the availability zones will be selected based on Confluent Cloud placement policies. One of the following options can be used to ensure connectivity to a Confluent Cloud multi availability zone cluster over AWS PrivateLink:
The following regions currently have more than three availability zones: us-east-1 (N. Virginia), us-west-2 (Oregon) and ap-northeast-1 (Tokyo)
Each Confluent Cloud single availability zone cluster using PrivateLink will be provisioned with service endpoints in one availability zone. The availability zone will be selected based on Confluent Cloud placement policies. One of the following options can be used to ensure connectivity to a Confluent Cloud single availability zone cluster over AWS PrivateLink:
For requirements of the AWS PrivateLink feature, see Requirements.
For additional information about AWS PrivateLink Support with Confluent Cloud, see this article on the Confluent blog.