# Associate Elastic IP on Startup via User-data

**URL:** https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072
**Category:** Wowza Streaming Engine
**Created:** [November 24, 2011, 3:55pm UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072 "2011-11-24T15:55:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Nick\_Batt](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@Nick\_Batt](https://community.wowza.com/u/Nick_Batt)
#### Post date: [November 24, 2011, 3:55pm UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072/1 "2011-11-24T15:55:23Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [November 24, 2011, 4:46pm UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072/2 "2011-11-24T16:46:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jeff\_bennyhoff](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@jeff\_bennyhoff](https://community.wowza.com/u/jeff_bennyhoff)
#### Post date: [December 22, 2011, 8:10am UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072/3 "2011-12-22T08:10:56Z")

</div>

> 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.

---

<div class="post-metadata">

### Author: ![Ian\_Beyer](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ian\_Beyer](https://community.wowza.com/u/Ian_Beyer)
#### Post date: [December 23, 2011, 12:30pm UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072/4 "2011-12-23T12:30:02Z")

</div>

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/](http://blog.ianbeyer.com/code/ec2-startup/ec2-wowza-origin-server-startup-script/)

-Ian

---

<div class="post-metadata">

### Author: ![Nick\_Batt](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@Nick\_Batt](https://community.wowza.com/u/Nick_Batt)
#### Post date: [November 24, 2011, 9:57pm UTC](https://community.wowza.com/t/associate-elastic-ip-on-startup-via-user-data/36072/5 "2011-11-24T21:57:50Z")

</div>

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?
