Intro

The objective behind this post is to setup AWS CLI on your local computer. Specifically, we detail instructions for installation on Windows using Cygwin and for OS X / Linux using shell.

Installing AWS CLI

AWS CLI is the command line interface to access Amazon Web Services. To use the installer script for the UIUC Big Data Image locally, you will need to install AWS CLI.

Windows Specific Instructions

Amazon makes available a MSI installer (64-bit or 32-bit) to install the AWS CLI into the Windows command line, which is available via opening your start menu and searching for cmd. However, Windows command line is lacking in many features. Thus, to avoid having to develop two separate scripts, we are going to emulate the linux environment on Windows via Cygwin and within this environment we are going to install AWS CLI.

Installing Cygwin and AWS CLI

The installation of Cygwin is available in both 64-bit and 32-bit MSI installer files. If you have already installed Cygwin, you will still need to follow the steps below to add the required packages.

Cygwin install starts off like normal:

Cygwin Installer Start

Then, you must select an installation source. In this case, just choose download from the internet:

Cygwin Select Source

Cygwin will then prompt you to choose where it should reside on your local machine. Note: Keep the default path directly into C:\, avoid placing it C:\Program Files

Cygwin Installation Location

Next, you will be prompted to specify where any of the addon packages should be downloaded to. I normally place them within the Downloads folder.

Cygwin Packages Download Location

Now, if you want to obscure your connection, feel free to add a proxy. Otherwise, click next.

Cygwin Internet Connection

Then, we need to select a mirror to download the packages from. I recommend http://mirrors.kernel.org since it is an official repository as well as being a highly trafficked mirror.

Cygwin Select Mirror

At long last, you will be prompted to select additional packages. It is helpful to use the search option to find the packages we need.

Cygwin Select Packages

We need the following packages:

  • libuuid-devel - Fixes a bug in the 64-bit Cygwin that causes ctypes.util to segfault when trying to find libuuid (/usr/bin/cyguuid-1.dll).
  • binutils - Provides management for .dlls
  • openssh, libssh2-devel, libssh2_1 - SSH Support
  • curl - Remote downloading
  • wget - An alternate form of remote downloading
  • python - Version 2.7.5

To obtain python, type python within the search field, expand the + side next to Python menu, and click once on the python entry to switch it from ‘skip’ to 2.7.5-3. A check should also appear under the Bin? column.

Cygwin Select Python Package

This process will need to be repeated for each package specified in the list above.

When all add on packages have been selected, press Next to move onto the installation of Cygwin.

Cygwin Installing Addons

After all packages have been downloaded and installed, Cygwin will close the installation by asking if you would like a shortcut placed on your desktop. Select the shortcut option:

Cygwin Finished Install

When we have finished installing Cygwin, we can open it by clicking:

Cygwin Icon

This will launch shell:

Cygwin Icon

To make sure everything installed correctly, type “ping illinois.edu”:

Cygwin Icon

Next, we need to install pip, which is a package manager for python applications:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py

Then, we need to install awscli via pip:

pip install awscli

OS X and Linux Specific Prerequisites

In order to install AWS CLI, we need to first have Python 2.7.9 and pip. Luckily, pip comes with Python 2.7.9.

To see if you have this version installed type:

python --version

pip --help

OS X Instructions

To install AWS CLI on OS X, we need to download Python 2.7.9 and run the installer file.

Linux Instructions

To install AWS CLI on RHEL-based Linux, we must first download Python 2.7.9.

sudo yum install gcc
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
tar -zxvf Python-2.7.9.tgz
cd Python-2.7.9
./configure
make
sudo make install

(Note, for Debian-based linux, just substitute yum with apt-get)

AWS CLI Installer for OS X and Linux

Now, we will download and install the AWS CLI for OS X and Linux

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Checking the Install

To see if AWS CLI is set up correctly run:

aws help