PRAVEEN SHRIVAS
PRAVEEN SHRIVAS

Reputation: 1

Is it possible to connect AWS RDS Instance outside the VPC with Public Accessibility as No?

The requirement is to connect to the AWS RDS from MYSQL Workbench and SnapLogic which is outside the amazon VPC. But the issue is public accessibility of the RDS instance is set as "NO". How will we able to connect the RDS Instance. Is there any possibility to connect using EC2 which will act as a bastion using which I can able to connect to the MySQL workbench? And what are the changes that need to be done from the Route table and VPC side? And most importantly what is the deal with snap logic.

Upvotes: 0

Views: 822

Answers (1)

PMah
PMah

Reputation: 738

https://aws.amazon.com/premiumsupport/knowledge-center/rds-connect-ec2-bastion-host/ gives instructions for setting up an EC2 instance as a bastion/jump server.

In essence, you create an EC2 instance in a public subnet. The EC2 instance's security group must be accessible from your local machine on port 22 (it is recommended to not have it open to the whole internet), and the RDS instance's security group must be accessible from the EC2 instance on port 3306.

Then you can create a ssh tunnel through the EC2 instance by executing the following on your local machine:

ssh -i <YourPemFile> ec2-user@<EC2_IPAddress> -L3306:<RdsEndpoint>:3306

And connect using MySQL workbench to localhost:3306.

Some db clients (e.g. DBeaver) can create this tunnel for you, which I find much easier.

Upvotes: 2

Related Questions