2

I have a single EC2 instance and a single Elastic IP. After the instance is stoped and then re-started, the association between the instance and the IP is lost and I have to manually re-associate.

Is there a way either through the AWS Management Console or programatically from within the instance to do the re-association?

user35042
  • 2,601
  • 10
  • 32
  • 57

1 Answers1

0

I was fairly certain that the association stayed, but if it doesn't:

  • Download the EC2 command line API tools (google how to do this for your OS)
  • Set up a simple script to re-associate itself on startup.
chrism2671
  • 2,549
  • 9
  • 34
  • 45
  • I am certain that, at least in my case, the IP does not remain associated after a stop/start cycle. I will try what you suggest with the API tools and comment later. – user35042 Feb 19 '11 at 19:18
  • 4
    The IP doesn't remain associated after a stop. They automatically deassociate it, and bill you $0.01 per hour you hold an unassociated IP. – BenGC Jul 08 '11 at 14:36
  • http://serverfault.com/questions/316403/what-is-the-best-practise-for-assigning-an-ec2-eip-after-starting-an-instance has an example script. – Dan Pritts Oct 27 '16 at 18:12