The default port for EDB Clusters is 5432, and this setting is fixed. However, if you wish to use a different port for your database connection, you can create an AWS Network Load Balancer to facilitate port mapping. This guide outlines the steps to create an AWS Network Load Balancer.
Prerequisites
1. A private endpoint must be created for establishing a private connection.
2. A security group rule should be added for the custom port.
Step 1: Obtain the Private IP Address for the Private Endpoint
My private IP address is 10.3.0.49
Step 2: Create an AWS Target Group
1. Set the target type to IP address.
2. The port for the target group should be 5432. Select the VPC associated with the private endpoint, then click Next.
3. Enter the IP address of the private endpoint found in Step 1, and click Include as pending below.
4. Create the target group.
Step 3: Create an AWS Network Load Balancer
1. Navigate to AWS EC2 -> Load Balancers -> Create Load Balancer -> Network Load Balancer.
2. Configure the load balancer settings.
3. Choose the network settings, including the VPC and subnet used by the private endpoint.
4. Select the appropriate security groups.
5. Choose the newly created target group and specify the desired custom port.
6. Create the Network Load Balancer.
Step 4: Connect the Cluster with the New Host and Port
1. Monitor the status of the network load balancer and the target group.
2. Obtain the new host from the network load balancer.
3. Connect the cluster using the new host and port.