Setup OpenVPN in AWS for RDS access
When we use AWS, often we will use RDS, for security reason, is better to not to expose to public.
What if we want to access via MySQL client? Here’s why we need VPN.
After you created an EC2 instance (I chose Ubuntu 18.04), then create an elastic IP and associate with this instance.
Because we don’t want risk the IP to change when the instance restarted.
2. Follow this post.
ubuntu@ip-172-xxx-xxx-xxx:~$ sudo bash openvpn-install.sh
The first time, enter the private IP (should be auto populated), then 2nd time is the elastic IP.
Now, you still won’t be able to connect to VPN yet.
Because the new instance doesn’t open some ports by default, now let create.
In the inbound tab:
|Custom UDP Rule||UDP||1194||0.0.0.0/0|
|Custom TCP Rule||TCP||943||0.0.0.0/0|
Then go back to instance menu, select the OpenVPN instance, and associate the VPN security group.
In the inbound tab
After this, you should be able to connect your local to VPN, and connect MySQL client to RDS.