If you have EC2 instances and other services running in AWS (Amazon Web Services) then at some point you may want to use a command line interface (CLI) instead of the AWS console.

I have a Mac and was excited to see that the AWS CLI is also available for OS X (or MacOS).

To start be sure you open a OS X Terminal window and then follow the following easy steps.

Here are 3 easy steps to install AWS CLI on your Mac

Step 1: Install AWS CLI using the OS X Bundled Installer.

First make sure that you have the correct version of Python installed.
python --version

Python version on Mac

If you don’t already have Python installed, then using the following link to Install Python.

Now download the AWSCLI installer using the following command:
curl "httpss://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

Step 2: Unzip the package

Next you want to unzip the downloaded AWSCLI package using the following command:
unzip awscli-bundle.zip

Unzip AWS CLI bundle on Mac

Step 3: Run the install executable and test the AWS CLI installation

The final step is to run the install executable and to test the AWS CLI command. This is a sudo command and you will be prompted for your password to continue. This is you Mac Administrator User Password. This step may take a few minutes to run, so be patient.

sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Now you can test if you correctly installed the AWS CLI using the AWS command:

aws help

You should now see the AWS Help screen. Success!

And then finally you can connect to your AWS environment using the following command (note you’ll have to set your own Key ID, Secret, Region and output format):

$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

You can find more detailed information and trouble shooting info here: Installing the AWS Command Line Interface.

Have fun using AWS CLI on your Mac. Do you have any cool tips to share?