mysql - Database reference a DNS name instead of IP address? -


i wondering if possible make database have dns name instead of ip address amazon rds? own website , wondering if there solution have db.website.com refer our amazon web services database? possible?

when database instance launched under amazon rds (relational database service), endpoint provided in form of:

db.crwobkqad31a.ap-southeast-2.rds.amazonaws.com:3306 

if wish apply more friendly dns name, configure cname record in dns server (eg amazon route 53) maps friendly name (eg db.website.com) database endpoint.

the dns name resolve ip address. if database publicly-accessible , name resolved outside amazon vpc, public ip address returned. if name resolved within amazon vpc, private ip address returned.

you typically want protect database outside access placing private subnet. unusual want give end-users direct access database (which i'm assuming want do, given desire friendly dns name), choice.


Comments