A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearIs there a way to associate an elastic IP address with EC2 instance on startup? - page 1
User InfoPosts
Is there a way to associate an elastic IP address with EC2 instance on startup?#1
Hi I am developing the code to start an instance of an EC2 image on Amazon Web Services, there are 2 steps

1) start the instance
2) allocate our Elastic IP address to the started instance

Is there a way to carry out both of these in a single command?

I will be running a .bat file to start the instance, and then when the instance is running I will use the REST query API to call AssociateAddress. I(m not sure yet how best to determine when the started instance changes from pending to running other than making periodic calls to it. Am I able to associate an IP address to a pending instance?

Stephen

posted date: 2009-04-08 02:07:00


Re: Is there a way to associate an elastic IP address with EC2 instance on startup?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-08 02:07:01


Re: Is there a way to associate an elastic IP address with EC2 instance on startup?#3
Sure, you(d need to add a startup script to your EC2 instance that runs the allocate-address command at boot time to do the association of the elastic IP. Here(s a tutorial on adding startup / shutdown scripts to an EC2 instance.

posted date: 2009-04-08 08:47:00


Re: Is there a way to associate an elastic IP address with EC2 instance on startup?#4
Thanks, but we are running instances made available by a third party ... so Im not sure if we'd be able to add our script. Do you mean that the script would be added as part of the AMI and then when you launch the image it would start the script. Can i send the script when starting the instance?

posted date: 2009-04-09 05:39:00


Re: Is there a way to associate an elastic IP address with EC2 instance on startup?#5
Hmm, you might be in a bit of a catch-22 here - you can pass parameters to an inat stance when you launch it, but your AMI needs to have a startup script that accepts those parameters. Have a look at developer.amazonwebservices.com/connect/… for how this works.

posted date: 2009-04-09 20:53:00


Re: Is there a way to associate an elastic IP address with EC2 instance on startup?#6
Yes, you can assign the IP to the pending instance. It(s handled from the firewalls and not your instance, so it doesn(t need to be running to make the change. Your instance never actually knows about the Elastic IP.

posted date: 2009-04-10 09:07:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.