Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
I'd +1 this a dozen times if I could. VPC is absolutely the way to go. –  ceejayoz Mar 25 '13 at 13:48
add comment

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.

share|improve this answer
    
I am using Windows 2008 Server R2. Where and how should I write a startup script ? –  Ashutosh Narayan Mar 25 '13 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 ? –  Ashutosh Narayan Mar 25 '13 at 8:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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