3

I started an Amazon RDS instance (with Multi-Az enabled) and was provided with a host name like instance.abc123.us-west-1.rds.amazonaws.com. Will this instance's hostname ever change? Can I use this hostname directly in my applications, or should I be using other DNS aliases (or AWS elastic IP addresses) or something?

simpleuser
  • 274
  • 1
  • 4
  • 14

2 Answers2

3

Amazon RDS instance hostnames don't change for as long as the instance is running. It persists reboots too. If you use a cluster, then you should use the cluster endpoint as the hostname in your applications. You could use the hostname as it is or create a simple CNAME record in your DNS to make it memorable.

eternaltyro
  • 262
  • 2
  • 14
  • 1
    "as long as the instance is running" - will it change if I modify the instance type (from small to medium, for example)? – simpleuser Sep 11 '17 at 19:15
  • 1
    @simpleuser it does not change. If you delete this instance and create a new one with the same db identifier, it even reclaims the old hostname. The random numbers/letters are an opaque identifier for your account that differs by region. It has no meaning but all of your ETA instances within a region will have that same string in their hostnames. See http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RenameInstance.html. – Michael - sqlbot Sep 11 '17 at 23:52
  • > If you delete this instance and create a new one with the same db identifier, it even reclaims the old hostname. Woah, I didn't know this. – eternaltyro Sep 12 '17 at 03:08
1

You should look into using Route53.. That's their DNS services. I recommend setting up Route53, adding a CNAME to your RDS instance so that you can have your code refer to it by hostname found in Route53 as opposed to the generic AWS Hostname. The generic hostname does not change for RDS but it would certainly be helpful to use Route53 to give it a better hostname.

ryekayo
  • 472
  • 5
  • 14