To enhance security, RDS instances are typically placed in a private subnet within a VPC, making them inaccessible from outside the VPC.
This solution provides a way to set up a proxy that forwards traffic from your client to the private RDS instance using an EC2 proxy instance.
To set up the proxy, you need to create an EC2 instance in a public subnet, collect the RDS instance information, configure the firewall, and set up the proxy using HAProxy.
Once the proxy is set up, you can connect to the RDS instance in the private subnet by replacing the RDS endpoint with the public IP of the EC2 proxy server.