5

Is it possible to assign a fixed Elastic IP to an AWS RDS database instance? If I create a new database instance, the instance gets a random endpoint like myDb.aws6z6uffdfv.us-west-2.rds.amazonaws.com:1433. I would like to map this to a static (and public) IP.

Or is there any alternative? Or workaround?

4

Well, it basically cannot be done. Question is, why would you want to do that? You have it always on the same hostname, so it is always accessible under the same endpoint all the time from the Internet. The only workaround, which we once used, when we wanted to grant external developer access to RDS instance, was making stunnel on development EC2 instance with Elastic IP. This way, the mysql connection endpoint was all the time the same IP, connection to RDS was managed on the EC2 side and every connection was SSL secured. But in most cases, this doesn't solve anything.

  • here's my use case: I want to create a new DB. After the DB is up, I want to run my DB setup to create tables and stored procedures. But to run the setup I need to know the hostname and add it to a properties file. If the hostname of the DB is random, I need to touch my properties file every time. I also want to run updates against my DB for which I also need the hostname. So it would be handy to know the hostname before I create the DB. I do this to build a test environment where I can create a new DB, run my setup, do some tests and tear it down again. – Thomas Uhrig Apr 15 '14 at 16:30
  • Then simply use RDS CLI: docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/… - with rds-describe-db-instances you get the RDS address in the Endpoint Address element: docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/… – Tomyk Apr 15 '14 at 20:41
  • 2
    It's useful if you migrate your database to a new instance (just did it from an old gen AWS type to a new type), if it was with an Elastic IP, I could have just switched it after the migration, while now I needed to adjust a DNS CNAME. – David Cumps Jun 27 '15 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.