0

I want to assign a reserved IP for an instance on EC2 so that I can use it in my configuration files. I associated an elastic IP with that instance but it changed when I stopped the instance. I have to setup application which depends on IP of instance, if IP changes, my application will fail to work. Please suggest a way so that the IP remains associated with instance permanently.

2 Answers 2

3

Deploy inside of a VPC. When you do this, you get many additional benefits, one of which are EIP mappings that persist through reboots.

VPC usage is free, they're quite simple to set up, so there's no good reason to not use them.

1
  • I'd +1 this a dozen times if I could. VPC is absolutely the way to go.
    – ceejayoz
    Mar 25, 2013 at 13:48
0

An Elastic IP address is the correct answer. It will be deallocated when you stop the instance, but you can allocate it back to the instance after you have restarted it. If necessary, you can write a startup script on the instance that will automatically allocate the Elastic IP address.

2
  • I am using Windows 2008 Server R2. Where and how should I write a startup script ? Mar 25, 2013 at 7:19
  • there is an option to associate elastic IP every time the instance is rebooted. Will the startup script take care of this,as there is only one network interface through which communication happens ? Mar 25, 2013 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .