Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 Instance : Access RDS via Alias Name

Is it possible to set up RDS in such a way that EC2 instances use the RDS Instance Identifier "mydb" to connect to RDS instead of using the public DNS name : mydb.cfnr64hlvtcp.us-east-1.rds.amazonaws.com. ?

like image 690
MadSeb Avatar asked Aug 26 '13 04:08

MadSeb


2 Answers

The only way to access an RDS database is by using the public DNS endpoint name generated by RDS when the database is created.

You could setup your own CNAME for the RDS DNS name if you wanted to hide the public DNS name from a component in your system, but then you must maintain that entry, which seems a bit complicated.

AWS strongly recommends that you don't use the IP address behind the RDS DNS entry directly since that IP may change, for example if your database has to failover to a new instance. [1]

[1] http://aws.amazon.com/rds/faqs/#What_is_a_DB_Subnet_Group_and_why_do_I_need_one

like image 144
Greg Kempe Avatar answered Sep 21 '22 23:09

Greg Kempe


AWS has documentation for creating RDS CNAME's:

http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-rds-db.html

like image 23
creichert Avatar answered Sep 21 '22 23:09

creichert