The Amazon Auto Scaling Command Line Tools are used to set up the automatic scaling of your Amazon EC2 capacity.

The Amazon Auto Scaling Command Line Tools require Java 1.5 or greater and require the following environment variables to be set:

Install Script

If you’re running Linux, this script will do everything this article covers: install_autoscaling.sh from our aws_scripts collection. Be sure to run it as root or use sudo.

Git Repository

Checkout the repository. This only needs to be done once throughout this series of articles.

Console - user@hostname ~ $

1
git clone https://bitbucket.org/dowdandassociates/aws_scripts.git

Run install script

Console - user@hostname ~ $

1
sudo aws_scripts/install_aws_cli/install_autoscaling.sh

Direct Download of Script

Console - user@hostname ~ $

1
curl -L https://bitbucket.org/dowdandassociates/aws_scripts/raw/master/install_aws_cli/install_autoscaling.sh | sudo bash

Install Process

Create the directory in which to download the software if it does not already exist.

Console - root@hostname ~ #

1
mkdir -p /tmp/aws

Create the directory in which to install the software if it does not already exist.

Console - root@hostname ~ #

1
mkdir -p /opt/aws

Download the software.

Console - root@hostname ~ #

1
2
3
curl --silent \
--output /tmp/aws/AutoScaling.zip \
http://ec2-downloads.s3.amazonaws.com/AutoScaling-2011-01-01.zip

Delete any previous unzips of the software that may exist.

Console - root@hostname ~ #

1
rm -fR /tmp/aws/AutoScaling-*

Unzip the software.

Console - root@hostname ~ #

1
unzip -d /tmp/aws /tmp/aws/AutoScaling.zip

Delete any previously installed versions.

Console - root@hostname ~ #

1
rm -fR /opt/aws/AutoScaling

Move the unzipped directory into the install directory.

Console - root@hostname ~ #

1
mv /tmp/aws/AutoScaling-* /opt/aws/AutoScaling

Delete the .zip file.

Console - root@hostname ~ #

1
rm -f /tmp/aws/AutoScaling.zip

Set AWS_AUTO_SCALING_HOME, and put the tools into the path.

Console - root@hostname ~ #

1
2
3
4
cat <<'EOF'>/etc/profile.d/AutoScaling.sh
export AWS_AUTO_SCALING_HOME=/opt/aws/AutoScaling
export PATH=$PATH:$AWS_AUTO_SCALING_HOME/bin
EOF

References

Parts in this series