Wowza Community

Associate Elastic IP on Startup via User-data

I’m trying to streamline the EC2 startup process for third party clients.

What I need to do is have an elastic IP address associate with a WOWZA EC2 instance when I boot up. Is it possible to do this via user data?

If anyone has an example, it will be most useful. many thanks

This is not possible with Wowza Startup package, as far as I know. I’m not sure how to automate that except with EC2 command line tools

Richard

I’m trying to streamline the EC2 startup process for third party clients.

What I need to do is have an elastic IP address associate with a WOWZA EC2 instance when I boot up. Is it possible to do this via user data?

If anyone has an example, it will be most useful. many thanks

I am looking for very something similar. I am using the EC2 API to try and script this and got half way there.

set JAVA_HOME=C:\Program Files\Java\jre6

set EC2_HOME=C:\path-to-ec2-API\ec2-api-tools-1.5.0.1-2011.11.30\

set EC2_PRIVATE_KEY=C:\PATH-TO-PRIVATE-EC2-CERT\PRIV.pem

set EC2_CERT=C:\PATHT-TO-PUBLIC-EC2-CERT\CERT.pem

ec2-run-instances ami-93824afa -g wowza

ec2-describe-instances

ec2-associate-address -i instanceID xx.xx.xx.xx

ec2-disassociate-address xx.xx.xx.xx

ec2-stop-instances instanceID

Looking for a clean way with a dos batch file to parse the ec2-describe-instances for the instance id to pass into the ec2-associate-address -i instanceID xx.xx.xx.xx

. If not i will have to use another language.

You can do it with unix shell (using cut/grep) or windows vbscript, although I have more experience with the former.

Your methodology is correct, however - once the run-instances is called, run describe-instances against the returned instance ID until status comes back as “running” and then do the associate-address.

Here’s an example on how to do it in unix/bash:

http://blog.ianbeyer.com/code/ec2-startup/ec2-wowza-origin-server-startup-script/

-Ian

Thats a drag, EC2 instances are great to fire up on demand, but having to manually assign IP too makes it a bit more cumbersome - or is there another way?