The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
Prerequisites Before We Begin
✅ Create an IAM user in your AWS account.
✅ Assign AdministratorAccess permissions to this user.
✅ Generate an Access Key and Secret Access Key for this IAM user.
These credentials will come in handy once we complete the CLI setup. We'll use them to log in via the terminal and run our first command:
𝐚𝐰𝐬 𝐢𝐚𝐦 𝐥𝐢𝐬𝐭-𝐮𝐬𝐞𝐫𝐬
If everything's set up correctly, this command will return a list of users in your AWS account right in your CLI.
A Step-by-Step guide on installing AWS CLI on Windows:
Step 1: Visit the AWS Documentation website to download the installer.
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
Step 2: Choose your operating system; in this case, I am selecting Windows.
Step 3: Click to download the AWS CLI MSI installer for Windows (64-bit).
https://awscli.amazonaws.com/AWSCLIV2.msi
Step 4: The setup process will take a minute or two.
Step 5: Once the setup is complete, click «Next.»
Step 6: Accept the license agreement and click «Next.»
Step 7: Click «Next» on the Custom Setup screen.
Step 8: Finally, click «Install.»
Step 9: After a few minutes, the installation will be complete.
Step 10: Open the Search menu and type «Command» to find the Command Prompt or Terminal.
Step 11: Open the Command Prompt or Terminal.
Step 12: Input 𝐚𝐰𝐬 --𝐯𝐞𝐫𝐬𝐢𝐨𝐧
to check the successful installation and to see the AWS version.
Step 13: Now, configure AWS in your Command Prompt.
Step 14: Enter your access key and secret key.
Step 15: Enter the region you want to use (I am entering Stockholm, which corresponds to eu-north-1).
Step 16: For the default output format, just hit Enter.
Step 17: To test the CLI, input 𝐚𝐰𝐬 𝐢𝐚𝐦 𝐥𝐢𝐬𝐭-𝐮𝐬𝐞𝐫𝐬
, and you will see the IAM users you created in the Management Console.
Conclusion
In this guide, we walked through the process of installing and configuring the AWS Command Line Interface (CLI) on a Windows system. With the setup complete and the CLI verified, you are now equipped to begin managing AWS services directly from your terminal.
Connect with me on Linkedin, let’s spark new ideas together!
In this step-by-step guide, you will learn how to install AWS CLI and configure the CLI to connect to AWS and execute the CLI commands.
AWS CLI supports the following platforms.
- Linux
- MAC
- WIndows.
We have added the commands to install AWS CLI on all three platforms in the way.
Install AWS CLI on Linux
If you are using Linux based system, you just need the execute the following commands.
Note: Ensure you have unzip utility installed on your Linux system
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
To validate the CLI installation, execute the CLI version command.
aws --version
To know the location of the binary, execute the following command. Usually it would be /usr/local/bin/aws
which aws
Install AWS CLI on MAC
AWS MAC CLI installation is very easy. You just need to install it using brew
.
If you don’t have homebrew, install it using the following command.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install the aws cli.
brew install awscli
Install AWS CLI on Windows
For windows download the aws cli MSI file and install it.
You can download the MSI file from here https://awscli.amazonaws.com/AWSCLIV2.msi
Configure AWS CLI
Before starting the configuration, you should have the AWS access key and secret key for your user. If you dont have these details, you can create one from the IAM console under your user name.
Go to “My Security Credentials” Under your Account Name in AWS Console.
Run the configure command.
aws configure
It will ask for the AWS access key, secret key, region, and default output format. provide the details you prefer.
For example,
vagrant@lab:~$ aws configure
AWS Access Key ID : [****************7PFK]
AWS Secret Access Key : [****************tEuh]
Default region name : us-west-2
Default output format : JSON
AWS CLI Config File Location
When you run the aws configure
command, a config file and credential file gets creates in the $HOME/.aws
location
The config file will have details except the access key and secret key.
The credentials file will have the access key and secret key.
When you execute an AWS CLI command, the CLI uses the config and credential file to authenticate against AWS API. You can change the values of these files with new values anytime you change the credentials or default region.
Verify AWS CLI Authentication
You can verify the AWS CLI authentication by executing any command that interacts with AWS API.
For example, we will list instances using the AWS CLI command.
aws ec2 describe-instances
Now let’s create an instance using the CLI. Replace the values with values that match your AWS account.
aws ec2 run-instances \
--image-id ami-0d70546e43a941d70 \
--count 1 \
--instance-type t2.micro \
--key-name bibin-server \
--security-group-ids sg-00cf38e1e1799e52a \
--subnet-id subnet-042384c724edd40c0 \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=cli-server}]' 'ResourceType=volume,Tags=[{Key=Name,Value=cli-server-disk}]'
AWS CLI FAQs
What is AWS CLI used for?
AWS CLI is used to manage AWS resources using the CLI utility. With AWS CLI you can authenticate to AWS services and manage them using the CLI commands. AWS CLI is written in python and it can be installed on Linux, MAC, and Windows systems.
Where is AWS CLI installed?
When you install AWS CLI, it gets installed as per the operating systems. In Linux & MAC systems, it gets installed in /usr/local/bin/aws
. For windows based systems, it gets installed in C:\Program Files\Amazon\AWSCLI (64-bit version)
or C:\Program Files (x86)\Amazon\AWSCLI
location.
What is the difference between AWS CLI and console?
With AWS CLI, you can have terminal-only access to AWS services. Meaning you have to use commands to list and manage AWS services. With AWS console, you can manage AWS resources from a web UI.
Conclusion
In this blog, we learned the easy ways to install AWS CLI utility and configure it to authenticate to an AWS account.
Next, we will see how to use the AWS CLI setup to create AWS resources.
aws-cli
This package provides a unified command line interface to Amazon Web
Services.
Jump to:
- Getting Started
- Getting Help
- More Resources
Getting Started
This README is for the AWS CLI version 1. If you are looking for
information about the AWS CLI version 2, please visit the v2
branch.
Requirements
The aws-cli package works on Python versions:
- 3.9.x and greater
- 3.10.x and greater
- 3.11.x and greater
- 3.12.x and greater
Notices
On 2025-04-22, support for Python 3.8 ended for the AWS CLI. This follows the
Python Software Foundation end of support
for the runtime which occurred on 2024-10-07.
For more information, see this blog post.
Attention!
We recommend that all customers regularly monitor the Amazon Web
Services Security Bulletins
website for
any important security bulletins related to aws-cli.
Maintenance and Support for CLI Major Versions
The AWS CLI version 1 was made generally available on 09/02/2013 and is currently in the full support phase of the availability life cycle.
For information about maintenance and support for SDK major versions and their underlying dependencies, see the Maintenance Policy section in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide.
Installation
Installation of the AWS CLI and its dependencies use a range of packaging
features provided by pip
and setuptools
. To ensure smooth installation,
it’s recommended to use:
pip
: 9.0.2 or greatersetuptools
: 36.2.0 or greater
The safest way to install the AWS CLI is to use
pip in a virtualenv
:
$ python -m pip install awscli
or, if you are not installing in a virtualenv
, to install globally:
$ sudo python -m pip install awscli
or for your user:
$ python -m pip install --user awscli
If you have the aws-cli package installed and want to upgrade to the
latest version, you can run:
$ python -m pip install --upgrade awscli
This will install the aws-cli package as well as all dependencies.
Note
On macOS, if you see an error regarding the version of six
that
came with distutils
in El Capitan, use the --ignore-installed
option:
$ sudo python -m pip install awscli --ignore-installed six
On Linux and Mac OS, the AWS CLI can be installed using a bundled
installer.
The AWS CLI can also be installed on Windows via an MSI
Installer.
If you want to run the develop
branch of the AWS CLI, see the
Development Version section of
the contributing guide.
See the
installation
section of the AWS CLI User Guide for more information.
Configuration
Before using the AWS CLI, you need to configure your AWS credentials.
You can do this in several ways:
- Configuration command
- Environment variables
- Shared credentials file
- Config file
- IAM Role
The quickest way to get started is to run the aws configure
command:
$ aws configure AWS Access Key ID: MYACCESSKEY AWS Secret Access Key: MYSECRETKEY Default region name [us-west-2]: us-west-2 Default output format [None]: json
To use environment variables, do the following:
$ export AWS_ACCESS_KEY_ID=<access_key> $ export AWS_SECRET_ACCESS_KEY=<secret_key>
To use the shared credentials file, create an INI formatted file like
this:
[default] aws_access_key_id=MYACCESSKEY aws_secret_access_key=MYSECRETKEY [testing] aws_access_key_id=MYACCESSKEY aws_secret_access_key=MYSECRETKEY
and place it in ~/.aws/credentials
(or in
%UserProfile%\.aws/credentials
on Windows). If you wish to place the
shared credentials file in a different location than the one specified
above, you need to tell aws-cli where to find it. Do this by setting the
appropriate environment variable:
$ export AWS_SHARED_CREDENTIALS_FILE=/path/to/shared_credentials_file
To use a config file, create an INI formatted file like this:
[default] aws_access_key_id=<default access key> aws_secret_access_key=<default secret key> # Optional, to define default region for this profile. region=us-west-1 [profile testing] aws_access_key_id=<testing access key> aws_secret_access_key=<testing secret key> region=us-west-2
and place it in ~/.aws/config
(or in %UserProfile%\.aws\config
on Windows). If you wish to place the config file in a different
location than the one specified above, you need to tell the AWS CLI
where to find it. Do this by setting the appropriate environment
variable:
$ export AWS_CONFIG_FILE=/path/to/config_file
As you can see, you can have multiple profiles
defined in both the
shared credentials file and the configuration file. You can then specify
which profile to use by using the --profile
option. If no profile is
specified the default
profile is used.
In the config file, except for the default profile, you must prefix
each config section of a profile group with profile
. For example, if
you have a profile named «testing» the section header would be
[profile testing]
.
The final option for credentials is highly recommended if you are using
the AWS CLI on an EC2 instance. IAM
Roles
are a great way to have credentials installed automatically on your
instance. If you are using IAM Roles, the AWS CLI will find and use them
automatically.
In addition to credentials, a number of other variables can be
configured either with environment variables, configuration file
entries, or both. See the AWS Tools and SDKs Shared Configuration and
Credentials Reference
Guide
for more information.
For more information about configuration options, please refer to the
AWS CLI Configuration Variables
topic.
You can access this topic from the AWS CLI as well by running
aws help config-vars
.
Basic Commands
An AWS CLI command has the following structure:
$ aws <command> <subcommand> [options and parameters]
For example, to list S3 buckets, the command would be:
$ aws s3 ls
To view help documentation, use one of the following:
$ aws help $ aws <command> help $ aws <command> <subcommand> help
To get the version of the AWS CLI:
$ aws --version
To turn on debugging output:
$ aws --debug <command> <subcommand>
You can read more information on the Using the AWS
CLI
chapter of the AWS CLI User Guide.
Command Completion
The aws-cli package includes a command completion feature for Unix-like
systems. This feature is not automatically installed so you need to
configure it manually. To learn more, read the AWS CLI Command
completion
topic.
Getting Help
The best way to interact with our team is through GitHub. You can open
an issue and
choose from one of our templates for guidance, bug reports, or feature
requests.
You may find help from the community on Stack
Overflow with the tag
aws-cli or on
the AWS Discussion Forum for
CLI. If you
have a support plan with AWS Support, you can also create
a new support case.
Please check for open similar
issues before opening
another one.
The AWS CLI implements AWS service APIs. For general issues regarding
the services or their limitations, you may find the Amazon Web Services
Discussion Forums helpful.
More Resources
- Changelog
- AWS CLI
Documentation - AWS CLI User
Guide - AWS CLI Command
Reference - Amazon Web Services Discussion
Forums - AWS Support
Working with Command Line can be painful specially if you are on Windows.
It doesn’t have to be anymore.
You will learn:
- How to download and install AWS CLI V2 in your Windows OS.
- How to create an IAM user for AWS CLI
- How to create access key and secret for IAM user
- How to configure AWS CLI using
aws configure
Let’s start with installing the CLI
The easy way using chocolatey:
Install chocolatey if you don’t have it already:
- Open PowerShell in Admin (Run as Administrator)
- Run the command below to install chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Finally install AWS CLI using choco
choco install awscli
Install manually using the MSI installer
Click to show installation instructions
Simply download the msi from [awscli.amazonaws.com/AWSCLIV2.msi](https://awscli.amazonaws.com/AWSCLIV2.msi)
Open the installer.

Click on **Next**, accept the license agreement, then click Next again.
Now all you need to do is click on Install.

In few minutes your AWS CLI will be installed in your Windows operating system.

Let’s create an IAM user for our AWS CLI!
Login to your AWS Console with admin access.
Go to your IAM User console.
Click on the Add Users button on the top-right of the Console.
Enter a username, e.g. my-cli-user.
Don’t use your existing IAM user, creating a sepaarate IAM user for CLI will
help you pinpoint your activity logs in CloudTrail. Another article will be
what happens when you accidentally make your Access Key public.
Click Next.
On the next screen, from the three options, select “Attach Policies Directly”.
From the “Permissions’ Policies” tab, check the option AdministratorAccess.
Scroll down and click Next.
To finish things off, on the Review and Create screen, simply click on Create
User.
We see that our new user my-cli-user has been created successfully.
Generating Access Key and Secret for the CLI user
Click on my-cli-user.
Visit the Security credentials tab.
Scroll down and go to the Access Keys section, and click on Create Access Key button.
Select the Command Line Interface (CLI) option.
Scroll down and check the box for I understand the above recommendation and
want to proceed to create an access key and hit Next.
Setting description tag is optional. Go ahead and click on Create Access Key.
Your access key has been created. You can simply download the .CSV file if you
want to reuse it.
It won’t be shown again.
Configuring AWS CLI
To configure AWS CLI in our computer, run the following command.
aws configure --profile cli-user
INFO: You can omit the
--profile cli-user
part if you don’t plan on using
multiple users.
It will ask for the following:
- Access Key
- Secret Access Key
- Region (e.g.
us-east-1
) - Output Format (
json
oryaml
)
This is how it should look:
AWS Access Key ID [None]: AKIAS75KUR6WAVS3L3NE
AWS Secret Access Key [None]: aPklnUwaOMHTm/nVEvVXV6ZZyH2u/BHKOWFeKJk5
Default region name [None]: us-east-1
Default output format [None]: json
Now you are all set.
Testing your AWS CLI
Run the following command to know your IAM identity:
aws sts get-caller-identity --profile cli-user
You will see your user Id and ARN:
{
"UserId": "AIDAS75KUR6WHT3V6PS25",
"Account": "205979422636",
"Arn": "arn:aws:iam::205979422636:user/my-cli-user"
}
This means you have set up everything properly and you can use AWS CLI to its full potential.
From here you can take your productivity to the next level.
Here are the list of things you can do with AWS CLI:
- Copy files from S3 to your local computer, or another bucket.
- Get real-time CloudWatch logs in your terminal.
- Run DynamoDB queries from your terminal.
- Easily update and delete secrets in SSM / Secrets Manager.
- Invoke Lambdas from AWS CLI
The possibilities are endless, you just have to think about it.
I hope you enjoyed reading this article and I solved your problem. If not, feel free to reach out to us, we’ll be happy to help.
Post Date:
– Last Modified:
This post is a how-to for installing & configuring AWS CLI (Version 2) on Windows.
In this guide, we’re going to download the AWS Command Line Interface installation media and run through the simple installation. Once done we’ll configure AWS CLI, which you’ll need an AWS Account to do so.
> Install AWS CLI V2 on Windows
> Configure AWS CLI V2
Install AWS CLI V2
Download AWS CLI V2 and run through the MSI installer. Run the .msi file you downloaded, and click next, next & done to complete the installation.
Alternatively, we can install AWS CLI using the PowerShell commands below.
# Download AWS CLI msi file, output to current directory Invoke-WebRequest -Uri https://awscli.amazonaws.com/AWSCLIV2.msi -UseBasicParsing -OutFile 'AWSCLIV2.msi' # Run AWS CLI install .\AWSCLIV2.msi
When the installation completes, close and re-open any terminals you have open. You should remember/consider doing this every time you install a package for development, close/reopen your VS Code or Windows Terminal.
Open your command terminal and verify the AWS CLI install by checking the version. Run ‘aws –version‘ as shown in the example below.
Configure AWS CLI V2
Now that we have AWS CLI installed on our machine, we need to open a web browser for the next steps, and head to the AWS Console.
Open AWS IAM and create/select a user with appropriate permissions. My ‘pete‘ login has full Admin (AdministratorAccess Policy) in this case.
Click on the Security Credentials tab within the user properties.
Scroll down to view & create Access Keys. Click to create a new key to see both the Access key ID and Secret Access Key of existing keys.
Open PowerShell and run ‘aws configure‘. You’ll be prompted for:
– AWS Access Key ID (above)
– AWS Secret Access Key (above)
– Default Region Name
– Default Output Format
Once you’ve entered these details for the first time it’ll save your details, so for me above I’m just hitting enter at each prompt.
Run ‘aws sts get-caller-identity‘ to confirm what you’re logged in as.