Is there any way to turn a non-elastic IP into an elastic IP on aws?
Asked Answered
O

3

14

I have done some research and don't think it is possible but figured I would ask on here just to be sure.

My predecessor decided to use the public and private IP of one of our database servers in an extremely large amount of places, now that we are going to be resizing this DB server going through and changing all of those IPs over would take a large amount of time and the possibility of missing one is pretty high.

I am wondering if it is at all possible to take the current IP on the server ( which is not elastic ) and some how convert it to an elastic IP. To clarify I am not looking to add a new elastic IP to the server but rather take the IP that is currently assigned to it and make that elastic. If this is not something that I can do using the SDK / Console is it something that Amazon could do behind the scenes if we were to get support?

Thanks !

Oxus answered 8/5, 2014 at 20:39 Comment(1)
Perhaps this is better? for file in $(grep "old.ip.ad.dr" ./* -RI); do ls $file; sed -i 's/old.ip.ad.dr/new.domain.for.that/' $file; doneAiken
I
17

No, it is not possible.

The Elastic IP addresses are a separate pool from the Public IP addresses. There is no public means to convert a public (or private) IP address to an Elastic IP.

Standard Amazon support is unlikely to be able to make such a switch for you. While technically an Amazon network engineer can probably make such a switch, it is very unlikely that support could make that happen.

Invention answered 8/5, 2014 at 20:41 Comment(4)
One thing you can do is keep the current instance running for a while and log all access to it. That way, if something is missed, you would at least have a log entry that something tried to access the old IP.Invention
...or proxy connections from the old instance to the new, after you migrate services to it. Better, of course, for the future... don't use IP addresses, use DNS hostnames. :)Abortionist
@Michael-sqlbot but the DNS hostnames change too when I re-assign the ip address (e.g. the instance hostname was ec2-1-2-3-4.eu-central-1.compute.amazonaws.com) But when i associated an elastic ip address, say 5.6.7.8 the hostname changed to ec2-5-6-7-8.eu-central-1.compute.amazonaws.com.. which means that even if were to use CNAMEs instead of A records in my domain's DNS I still would have to make the switch.. So my question is: is there a way to refer to the instance in the DNS so that changing the IP address does not affect it (except maybe using a load balancer)Darkish
@Darkish if you buy a domain name somewhere, you can use Amazon Route 53 to direct traffic that comes to that domain name, to any IP address you like, and you can change it anytime, for instance if your EC2 server IP address changes aws.amazon.com/route53Eggplant
G
0

If this is not something that I can do using the SDK / Console is it something that Amazon could do behind the scenes if we were to get support?

Amazon can create a reverse DNS record for a mail server manually and is known to implement features that users request, so I guess it might be worth asking. I would give it a try.

Gaelan answered 8/5, 2014 at 21:1 Comment(2)
That does not help. They have hard-coded the public IP address in various places. Nothing to do with DNS.Invention
Of course not. All I am saying is, if Amazon can create a reverse DNS for a mail exchanger, they can make modifications manually, and so it would not hurt to ask what this manual conversion to an elastic IP would cost.Gaelan
G
-1

So long as you do not terminate the instance, its static IP should remain assigned to it per Amazon documentation (https://aws.amazon.com/articles/1346).

now that we are going to be resizing this DB server

You can resize the instance and keep its static IP without terminating it (and thus without losing the static IP). The moment you terminate that instance, you lose the static IP, so resize it without terminating it.

Gaelan answered 8/5, 2014 at 20:55 Comment(2)
Stopping an instance will also release the IP address.Annettaannette
You don't always have control over whether or not your instance terminates. AWS routinely enough decommissions hardware, giving a few month's advance notice that the affected instances need to be migrated. Sometimes, too, and instance outright goes away.Invention

© 2022 - 2024 — McMap. All rights reserved.