0
votes

I am running multiple SQL instances in Google Cloud Platform (GCP). I have multiple masters with some read-replicas. Each instance has an private IP-address based on the region it is in, all instances use the same stock MySQL port (3306).

In the same VPC I have a few compute engines that can connect to each of the SQL instance without any problems. But I also have a few clients that need to connect from outside the VPC, through the internet so to say.

The question is how can I forward certain ports to the right internal IP-address in my VPC? IE:

x.x.x.x:12345 -> 10.x.x.1:3306
x.x.x.x:23456 -> 10.x.x.2:3306
x.x.x.x:34567 -> 10.x.x.3:3306
1

1 Answers

1
votes

You can use 'protocol forwarding for private regional forwarding rules' enter here with 'VPC subnet ranges' enter here . Use this feature to configure private forwarding rules that send TCP or UDP traffic to a target instance in the same region. You can also switch private regional forwarding rules from using target instances to backend services and vice versa