Skip to main content

How to Use AWS CLI

The AWS Command Line Interface (CLI) is for managing your AWS services from a terminal session on your own client, allowing you to control and configure multiple AWS services.

So you’ve been using AWS for awhile and finally feel comfortable clicking your way through all the services. However, you may have noticed that there is more to AWS than the default eye-catching browser console.

Maybe it’s time you checked out the AWS CLI (Command Line Interface). The AWS CLI is a unified tool to manage your AWS services from a terminal session on your own client. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts. In this blog, I will show you how to use AWS CLi and how to install it on your Windows, Linux, Mac, or Unix Operating System.

The more you use the AWS CLI, the more you’ll see how powerful it is. The Cloud Academy AWS Command Line Interface course can guide you through some of the interface’s many uses.

Here’s how you can download AWS CLI

  1. Install the AWS CLI on Windows
  2. Download the appropriate MSI installer
  3. Run the downloaded MSI installer
  4. Follow the instructions that appear

Note: The 64-bit version of the AWS CLI does not currently work with Windows Server 2008 (version 6.0.6002). Please use the 32-bit installer with this version of Windows.

Confirm the installation:
To confirm the installation, use the aws –version command at a command prompt (open the START menu and search for “cmd” if you’re not sure how to find the command prompt).

64 Bit
The CLI installs to C:\Program Files\Amazon\AWSCLI

C:\Program Files\Amazon\AWSCLI>aws --version
aws-cli/1.7.24 Python/2.7.9 Windows/8

32 Bit
The CLI installs to C:\Program Files (x86)\Amazon\AWSCLI

C:\Program Files (x86)\Amazon\AWSCLI>aws --version
aws-cli/1.7.24 Python/2.7.9 Windows/7

Once you have installed AWS CLI on your PC, you’ll need one more step to be able to connect to your AWS account.

For Windows, in my opinion, the…

aws configure

…command is the fastest way to set up your AWS CLI installation.

Through aws configure, the AWS CLI will prompt you for four pieces of information. The first two are required. These are your AWS Access Key ID and AWS Secret Access Key, which serve as your account credentials. (You can generate new credentials within AWS Identity and Access Management (IAM) if you do not already have them.) The other information you will need is region and output format, which you can leave as default for the time being.

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

That should be it. One command you can execute from your command prompt is to list any S3 buckets you have. Try the following (provided you have permission to list S3 buckets):

aws s3 ls

Install the AWS CLI on Linux, Mac or Unix Operating System


    • Linux, OS X, or Unix
    • Python 2.6.3 or later

*A full overview on prerequisites is outlined on the AWS CLI page.

Check your Python installation:

$ python --version

If Python is not installed on your computer or you would like to install a different version of Python, follow the procedures outlined in the Python user guide documentation.

This post offers a quick guide to installing the Python version of AWS CLI on Windows.

Follow these steps from the command line to install the AWS CLI:

$ curl "" -o ""
$ unzip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Add your Access Key ID and Secret Access Key to ~/.aws/config using this format:

aws_access_key_id = <access key id>
aws_secret_access_key = <secret access key>
region = us-east-1

Protect the config file:

chmod 600 ~/.aws/config

Optionally, you can set an environment variable pointing to the config file. This is especially important if you want to keep it in a non-standard location. For future convenience, also add this line to your ~/.bashrc file:

export AWS_CONFIG_FILE=$HOME/.aws/config

That should be it. Try out the following from your command prompt and if you have any S3 buckets you should see them listed (again, provided you have permission to list S3 buckets):

aws s3 ls

Here is the basic AWS CLI command structure. Keep in mind that any commands you enter in the CLI will have this standard format:

aws <command> <subcommand> [options and parameters*]

*Parameters can take various types of input values including numbers, strings, lists, maps, and JSON structures.

Next Steps

With the AWS CLI now installed on your client, you can take the next steps to scripting AWS services.

Written by

Stuart Scott

Stuart is the AWS content lead at Cloud Academy where he has created over 40 courses reaching tens of thousands of students. His content focuses heavily on cloud security and compliance, specifically on how to implement and configure AWS services to protect, monitor and secure customer data and their AWS environment.

Related Posts

Sanket Dangi
— February 11, 2019

WaitCondition Controls the Pace of AWS CloudFormation Templates

AWS's WaitCondition can be used with CloudFormation templates to ensure required resources are running.As you may already be aware, AWS CloudFormation is used for infrastructure automation by allowing you to write JSON templates to automatically install, configure, and bootstrap your ...

Read more
  • AWS
  • formation
Andrew Larkin
— January 24, 2019

The 9 AWS Certifications: Which is Right for You and Your Team?

As companies increasingly shift workloads to the public cloud, cloud computing has moved from a nice-to-have to a core competency in the enterprise. This shift requires a new set of skills to design, deploy, and manage applications in cloud computing.As the market leader and most ma...

Read more
  • AWS
  • AWS certifications
Andrew Larkin
— November 28, 2018

Two New EC2 Instance Types Announced at AWS re:Invent 2018 – Monday Night Live

The announcements at re:Invent just keep on coming! Let’s look at what benefits these two new EC2 instance types offer and how these two new instances could be of benefit to you. If you're not too familiar with Amazon EC2, you might want to familiarize yourself by creating your first Am...

Read more
  • AWS
  • EC2
  • re:Invent 2018
Guy Hummel
— November 21, 2018

Google Cloud Certification: Preparation and Prerequisites

Google Cloud Platform (GCP) has evolved from being a niche player to a serious competitor to Amazon Web Services and Microsoft Azure. In 2018, research firm Gartner placed Google in the Leaders quadrant in its Magic Quadrant for Cloud Infrastructure as a Service for the first time. In t...

Read more
  • AWS
  • Azure
  • Google Cloud
Khash Nakhostin
Khash Nakhostin
— November 13, 2018

Understanding AWS VPC Egress Filtering Methods

In order to understand AWS VPC egress filtering methods, you first need to understand that security on AWS is governed by a shared responsibility model where both vendor and subscriber have various operational responsibilities. AWS assumes responsibility for the underlying infrastructur...

Read more
  • Aviatrix
  • AWS
  • VPC
Jeremy Cook
— November 10, 2018

S3 FTP: Build a Reliable and Inexpensive FTP Server Using Amazon’s S3

Is it possible to create an S3 FTP file backup/transfer solution, minimizing associated file storage and capacity planning administration headache?FTP (File Transfer Protocol) is a fast and convenient way to transfer large files over the Internet. You might, at some point, have conf...

Read more
  • Amazon S3
  • AWS
Guy Hummel
— October 18, 2018

Microservices Architecture: Advantages and Drawbacks

Microservices are a way of breaking large software projects into loosely coupled modules, which communicate with each other through simple Application Programming Interfaces (APIs).Microservices have become increasingly popular over the past few years. The modular architectural style,...

Read more
  • AWS
  • Microservices
Stuart Scott
— October 2, 2018

What Are Best Practices for Tagging AWS Resources?

There are many use cases for tags, but what are the best practices for tagging AWS resources? In order for your organization to effectively manage resources (and your monthly AWS bill), you need to implement and adopt a thoughtful tagging strategy that makes sense for your business. The...

Read more
  • AWS
  • cost optimization
Stuart Scott
— September 26, 2018

How to Optimize Amazon S3 Performance

Amazon S3 is the most common storage options for many organizations, being object storage it is used for a wide variety of data types, from the smallest objects to huge datasets. All in all, Amazon S3 is a great service to store a wide scope of data types in a highly available and resil...

Read more
  • Amazon S3
  • AWS
Cloud Academy Team
— September 18, 2018

How to Optimize Cloud Costs with Spot Instances: New on Cloud Academy

One of the main promises of cloud computing is access to nearly endless capacity. However, it doesn’t come cheap. With the introduction of Spot Instances for Amazon Web Services’ Elastic Compute Cloud (AWS EC2) in 2009, spot instances have been a way for major cloud providers to sell sp...

Read more
  • AWS
  • Azure
  • Google Cloud
  • SpotInst
Guy Hummel and Jeremy Cook
— August 23, 2018

What are the Benefits of Machine Learning in the Cloud?

A Comparison of Machine Learning Services on AWS, Azure, and Google CloudArtificial intelligence and machine learning are steadily making their way into enterprise applications in areas such as customer support, fraud detection, and business intelligence. There is every reason to beli...

Read more
  • AWS
  • Azure
  • Google Cloud
  • Machine Learning
Albert Qian
Albert Qian
— August 9, 2018

AWS Summit Chicago: New AWS Features Announced

Thousands of cloud practitioners descended on Chicago’s McCormick Place West last week to hear the latest updates around Amazon Web Services (AWS). While a typical hot and humid summer made its presence known outside, attendees inside basked in the comfort of air conditioning to hone th...

Read more
  • AWS
  • AWS Summits