What Is the AWS Command Line Interface?
On January 10th, 2020, AWS CLI version 1, which requires a separate installation of Python to operate, stopped supporting Python versions 2.6 and 3.3. All builds of AWS CLI version 1 released after January 10th, 2020, starting with version 1.17, require Python 2.7, Python 3.4, or a later version to successfully use the AWS CLI.
This change does not affect the following versions of the AWS CLI:
-
Windows MSI installer version of AWS CLI version 1. The Windows MSI installer for AWS CLI version 1 includes and uses its own embedded copy of Python, independent of any other Python version that you might have installed. If you're using an MSI installer-based AWS CLI, no changes are required.
-
AWS CLI version 2. All installers for AWS CLI version 2 include and use an embedded copy of Python, independent of any other Python version that you might have installed. If you're using AWS CLI version 2, no changes are required.
For more information, see Using the AWS CLI version 1 with Earlier Versions of
Python in this guide, and
the deprecation announcement in this blog post
The AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell.
The AWS CLI is available in two versions:
-
Version 2.x – The current, generally available release of the AWS CLI that is intended for use in production environments. This version does include some "breaking" changes from version 1 that might require you to change your scripts so that they continue to operate as you expect. For a list of new features and breaking changes in version 2, see Breaking Changes – Migrating from AWS CLI version 1 to version 2.
-
Version 1.x – The previous version of the AWS CLI that is available for backwards compatiblity.
Information in this guide applies to both versions unless we specifically state that it applies to only one version or the other.
With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based AWS Management Console from the command prompt in your favorite terminal program:
-
Linux shells – Use common shell programs such as
bash, zsh, and tcshto run commands in Linux or macOS. -
Windows command line – On Windows, run commands at the Windows command prompt or in PowerShell.
-
Remotely – Run commands on Amazon Elastic Compute Cloud (Amazon EC2) instances through a remote terminal program such as PuTTY or SSH, or with AWS Systems Manager.
All IaaS (infrastructure as a service) AWS administration, management, and access functions in the AWS Management Console are available in the AWS API and CLI. New AWS IaaS features and services provide full AWS Management Console functionality through the API and CLI at launch or within 180 days of launch.
The AWS CLI provides direct access to the public APIs of AWS services. You can explore a service's capabilities with the AWS CLI, and develop shell scripts to manage your resources. Or, you can take what you learn to develop programs in other languages by using the AWS SDKs.
In addition to the low-level, API-equivalent commands, several AWS services provide
customizations for the AWS CLI. Customizations can include higher-level commands that
simplify
using a service with a complex API. For example, the aws s3 commands provide a
familiar syntax for managing files in Amazon Simple Storage Service (Amazon S3).
Example Upload a file to Amazon S3
aws s3 cp provides a shell-like copy command, and automatically performs
a multipart upload to transfer large files quickly and resiliently.
$aws s3 cp myvideo.mp4 s3://mybucket/
Performing the same task with the low-level commands (available under aws
s3api) would take a lot more effort.
Depending on your use case, you might want to choose one of the AWS SDKs or the AWS Tools for PowerShell:
You can view—and fork—the source code for the AWS CLI on GitHub in the aws-cli repository
Using the Examples
The examples in this guide are formatted using the following conventions:
-
Prompt – The command prompt is typically displayed as a dollar sign followed by a space (
$). For commands that are Windows specific,C:\>is used as the prompt. Do not include the prompt when you type commands. -
Directory – When commands must be executed from a specific directory, the directory name is shown before the prompt symbol.
-
User input – Command text that you should enter at the command line is formatted as
user input. -
Replaceable text – Variable text, including names of resources that you choose, or IDs generated by AWS services that you must include in commands, is formatted as
replaceable text. In multiple-line commands or commands where specific keyboard input is required, keyboard commands can also be shown as replaceable text. -
Output – Output returned by AWS services is shown under user input, and is formatted as
computer output.
For example, the following command includes user input, replaceable text, and output.
$aws configureAWS Access Key ID [None]:AWS Secret Access Key [None]:AKIAIOSFODNN7EXAMPLEDefault region name [None]:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYDefault output format [None]:us-west-2ENTER
To use this example, enter aws configure at the command line,
and then press Enter. The command is aws
configure. This command is interactive, so the AWS CLI outputs lines of
text, prompting you to enter additional information. Enter each of your access keys
in
turn, and then press Enter. Then, enter an AWS Region name in the
format shown, press Enter, and then press
Enter a final time to skip the output format setting. The final
Enter command is shown as replaceable text because there is no
user input for that line. Otherwise, it would be implied.
The following example shows a simple noninteractive command with output from the
service in JSON
$aws ec2 create-security-group --group-namemy-sg--description "My security group"{ "GroupId": "sg-903004f8" }
To use this example, enter the full text of the command (the highlighted text after
the prompt), and then press Enter. The name of the security group,
, is replaceable. You can use the
group name as shown, but you probably want to use a more descriptive name.
my-sg
Arguments that must be replaced (such as AWS Access Key ID),
and those that should be replaced (such as group name), are both
shown as replaceable text in italics. If an argument must
be replaced, it's noted in the text that describes the example.
The JSON document, including the curly braces, is output. If you configure your CLI
to
output in text or table format, the output will be formatted differently. JSON
About Amazon Web Services
Amazon Web Services (AWS) is a collection of digital infrastructure
services that developers can leverage when developing their applications.
The services include computing, storage, database, and application
synchronization (messaging and queuing). AWS uses a pay-as-you-go service model.
You are charged only for the services that you—or your applications—use.
Also, to make AWS more approachable as a platform for prototyping and
experimentation, AWS offers a free usage tier. On this tier, services are free below
a certain level of usage. For more information about AWS costs and the Free Tier,
see
Test-Driving AWS in the Free Usage Tier.
To obtain an AWS account, open the
AWS home page

