Re: AWS Bash Scripts

9 views
Skip to first unread message

Doug Chang

unread,
Jun 1, 2010, 8:59:25 PM6/1/10
to hacker-...@googlegroups.com
Hey Ivan: how about writing it up and we can post it for everybody else to see? Post it on the wiki.

Amazon is coming in a month. Good way to get some recognition for your efforts.

dc


------ Original Message ------
Received: 02:39 PM PDT, 06/01/2010
From: Scott Haines <sc...@newfrontcreative.com>
To: hacker-...@googlegroups.com
Subject: Re: AWS Bash Scripts


Ivan,
You are awesome, this is a great example of how to use the AMI to your advantage. The big problem most people have at the beginning is learning how to "think" in the cloud, and I have definitely terminated an instance without thinking and lost lots of time in the past, it is a good habit to get into. If you have made significant progress on your instance, just save it, then you are more free to get it going either as a mirrored server, or a testing server.

Ivan thanks again for sharing with the php group.

On Tue, Jun 1, 2010 at 1:45 PM, Ivan Barrios <ivan.b...@gmail.com> wrote:
This is a slightly advanced topic, but if you ever wanted to tweak Scott's AMI (to add software or change configuration of the OS slightly, or whatever), what happens is that you have to save the AMI and then store it in S3, before shutting down the instance. (Otherwise you will lose all of your changes) I found it tedious to repeatedly type in the command-line commands for the EC2 API to accomplish this, so I wrote 3 little bash scripts that are wrappers to the EC2 commands that helped me to remember what information to pass to the commands.

Execution Sequence
1) Run upload_certs.sh - this copies your public & private AWS keys to the instance that you've already started.
2) Run wrap_up.sh - this executes a series of commands that bundle up the targeted instance and store it in your S3 storage, so that you can use the image later when you want to bring up that instance.
3) delete_bundle.sh - this deletes old versions of your image that you don't want to pay to keep stored in S3.

Of course, all of these scripts require you to edit some of the fields to make them conform to your unique AWS account info. (for example -b field should be populated by the bucket name you choose for your company, instead of "crosspath") Also, these scripts require that you have the AWS command line tools on the machine where you run these scripts. 

Another helpful tool is the ElasticFox plugin for Firefox.
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1797&categoryID=174
I highly recommend using this tool - it's a nice GUI that makes starting your instances up and shutting them down, more intuitive. Most of the input data that the above scripts ask for, you can copy out of the ElasticFox GUI and paste into the command-line terminal where you are running the script.

Another helpful resource is the EC2 Forum, where you can ask detailed questions if you get stuck on something. (http://developer.amazonwebservices.com/connect/forum.jspa?forumID=30)

Cheers,

Ivan






--
Scott Haines
Founder / Creative Director / Lead Architect
Newfront Creative LLC
P 408.905.8473 C 408.705.7833
http://www.newfrontcreative.com
http://www.twitter.com/newfront




Reply all
Reply to author
Forward
0 new messages