How to connect easily to a private Amazon RDS without EC2 instances

Disclaimer.

My client owns its own domain, I haven’t tested it without a domain. If you test it and got great results, please share them in the comments section below.

If you have been developing apps or you are new to AWS, you might have e…


This content originally appeared on DEV Community and was authored by Federico Navarrete

Disclaimer.

My client owns its own domain, I haven't tested it without a domain. If you test it and got great results, please share them in the comments section below.

If you have been developing apps or you are new to AWS, you might have experienced some challenges; especially, when you are running them under a private subnet.

A common tutorial is this one from AWS:

How can I connect to a private Amazon RDS DB instance from a local machine using an Amazon EC2 instance as a bastion host?

Generally speaking, it's overcomplicated. My client has some extreme policies that force the tutorial to fail epically. We needed to do some extra workarounds in the AWS CLI to make it work, including opening the specific ports in advance (5432 [PostgreSQL], for instance).

Recently, I found an easier way that worked for us to create a Create private hosted zone with our domain and the region we preferred (eu-west-1) in Route 53, for example:

00027384723984729.eu-west-1.loc.supernova.com

Next, inside your hosted zone you need to create a new record using your RDS instance endpoint, for example:

database-1.cwfas04jasa01.eu-west-1.rds.amazonaws.com

Your new record must contain the following:

  • Record name: the name you want to give like homeapp
  • Record type: choose the option: CNAME.
  • Value: the endpoint in your RDS instance: database-1.cwfas04jasa01.eu-west-1.rds.amazonaws.com

Do click in Create records and that's all. You will get something like this:

homeapp.00027384723984729.eu-west-1.loc.supernova.com

After this, you can access your RDS instance without any extra EC2s or complex workarounds. If you face any troubles, verify if you have the DB ports are open in your firewall.

Banner credits:

http://trekintech.com/backup-recovery-for-aws-rds/


This content originally appeared on DEV Community and was authored by Federico Navarrete


Print Share Comment Cite Upload Translate Updates
APA

Federico Navarrete | Sciencx (2021-05-15T13:27:06+00:00) How to connect easily to a private Amazon RDS without EC2 instances. Retrieved from https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/

MLA
" » How to connect easily to a private Amazon RDS without EC2 instances." Federico Navarrete | Sciencx - Saturday May 15, 2021, https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/
HARVARD
Federico Navarrete | Sciencx Saturday May 15, 2021 » How to connect easily to a private Amazon RDS without EC2 instances., viewed ,<https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/>
VANCOUVER
Federico Navarrete | Sciencx - » How to connect easily to a private Amazon RDS without EC2 instances. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/
CHICAGO
" » How to connect easily to a private Amazon RDS without EC2 instances." Federico Navarrete | Sciencx - Accessed . https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/
IEEE
" » How to connect easily to a private Amazon RDS without EC2 instances." Federico Navarrete | Sciencx [Online]. Available: https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/. [Accessed: ]
rf:citation
» How to connect easily to a private Amazon RDS without EC2 instances | Federico Navarrete | Sciencx | https://www.scien.cx/2021/05/15/how-to-connect-easily-to-a-private-amazon-rds-without-ec2-instances/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.