This blogs deals with AWS RDS setup and Openvpn. Due to lots of cybersecurity threats going on we have to keep our RDS/DB’s very secure to avoid any threats for our data.
While creating RDS instance, we have the option of keeping the instance public or private. Now how to access instance if we keep it private. Its always recommended to keep RDS/DB private, but how to do so.
In this setup, 1 – vpc is present which has both public and private subnets, 1 -RDS instance which is deployed on private subnet of the same vpc along with public_accessible=false and 1 – Ec2 instance which is delpoyed on public subnet of the same vpc.
Reference:

Now, in order to setup rds instance and vpc, you can either go through aws console or terraform(IaC). I have used terraform.
Steps:
- Create vpc.
- Create ec2-instance and install openvpn-server on it.
- Create RDS instance.
Attached screenshots for POC:
- terraform apply output
- terraform output
- ec2 openvpn from aws console
- openvpn-client
- db-client





Reference:
Repo: link
Openvpn_setup: link
