The IAM Command Line Toolkit is used to interface with Amazon’s Identity and Access Management service. This service is used to manage your users access to AWS services and resources; it allows for creation of users and groups under your AWS account.

The IAM Command Line Toolkit requires Java 1.6 or greater and requires the following environment variables to be set:

Install Script

If you’re running Linux, this script will do everything this article covers: install_iamcli.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_iamcli.sh

Direct Download of Script

Console - user@hostname ~ $

1
curl -L https://bitbucket.org/dowdandassociates/aws_scripts/raw/master/install_aws_cli/install_iamcli.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
4
curl \
--silent \
--output /tmp/aws/IAMCli.zip \
http://awsiammedia.s3.amazonaws.com/public/tools/cli/latest/IAMCli.zip

Delete any previous unzips of the software that may exist.

Console - root@hostname ~ #

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

Unzip the software.

Console - root@hostname ~ #

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

Delete any previously installed versions.

Console - root@hostname ~ #

1
rm -fR /opt/aws/IAMCli

Move the unzipped directory into the install directory.

Console - root@hostname ~ #

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

Delete the .zip file.

Console - root@hostname ~ #

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

Set EC2_HOME, and put the tools into the path.

Console - root@hostname ~ #

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

References

Parts in this series

Comments