How to Install and Configure AWS CLI on Windows

How to Install and Configure AWS CLI on Windows

How to Install and Configure AWS CLI on Windows

Dear Reader, Hope you are well today 🙂 . In today’s post, I will help you install and configure AWS CLI on windows machine.

AWS CLI makes it easy to create and manage various AWS resources. So, if you are someone who interacts a lot with AWS services, I am sure, having CLI at the reach of your fingertips is gonna make your life a lot easier.

Suggested Read: 5 Ways to Create and Manage AWS Resources

What is AWS CLI?

AWS CLI or Command Line Interface is an amazing unified tool from AWS which lets you create and manage AWS resources from one place.

As the name says, you do it all from the command line either manually or automating the API calls through scripts.

Important Note: Please note that, AWS recommends to use CLI v2. As per AWS new features are not back-ported to v1 hence we must use v2 only. Therefore, this tutorial focuses on CLI v2(major latest version).

Prerequisites:

  • A 64-bit version of Windows XP or later.
  • Admin rights to install software
  • An AWS account
  • Handy Access Keys-Secret keys /Permission to generate them

Let’s break this tutorial into two parts.

  1. How to install AWS CLI on Windows
  2. How to Configure AWS CLI

1.How to install AWS CLI on Windows

Download the latest version of CLI MSI installer using below link

As soon as you click on the link, the MSI installer is downloaded.

Run the Downloaded installer by opening it.

You will see something like-

How to Install and Configure AWS CLI on Windows

Click Next

Accept the license agreement and click Next.

By default Installation directory is C:\Program Files\Amazon\AWSCLIV2. However, you are free to choose any other location. Click on Browse to choose your convenient location for this installation.

How to Install and Configure AWS CLI on Windows 2

Click Next, and then click on Install.

The installation starts and you see the status bar as below.

 How to Install and Configure AWS CLI on Windows 3

Once, the installation is finished, click on Finish.

Verify Installation

Installation is finished. So ideally it’s time to verify the installation.

Let’s do it !!!

Open command prompt by going start menu and searching for cmd

Open command prompt, and enter below command

aws --version

If the installation is successful, you see something like below-

How to Install and Configure AWS CLI on Windows version 4

Installation is verified, let’s configure the CLI to to able to interact with our AWS account resources.

2. How to Configure AWS CLI

In order to interact with AWS services, CLI needs your security credentials, default output format and default AWS region.

We will configure these settings in this section.

To be honest, I find aws configure command to be the fastest and easiest way to configure our CLI

Important Note: At this point of time, you should have your AWS Access/Secret keys handy with you to be able to configure you CLI. If you have them ready, jump straight to AWS CLI configuration section. But, If you don’t have these, don’t worry, we will generate it right now.

Generate AWS security credentials

Login to AWS Management Console and open AWS IAM.

Go to Users -> Click on Your User Name

Go to Security Credentials tab, and scroll down to access keys section.

Click on Create access key as shown in below screenshot.

Key is successfully generated and you are given option to download it. Please click on Download .csv file to download the csv file.

Important Note:

  • As above success message says, this is the only time you can download the keys. So, please download the key straight away.
  • Never ever ever generate and use Access key pair for your root account

Configure AWS CLI using aws configure

We have AWS Access Keys/Secret key handy now. So let’s go ahead and configure the CLI.

In your command line, issue below command.

aws configure

Once you hit enter, CLI will prompt you for below information one by one-

  • Access Key ID
  • Secret Access Key
  • Default region name
  • Default output format

Access key pair(Access Key ID and Secret Access Key) are used to sign programmatic request that you make to AWS services.

Default region is the region your request is sent to if you don’t specify a region explicitly in your request

Default output format means how the results are formatted. It defaults to json. However, you can specify any one of below value-

  • json
  • yaml
  • yaml-stream
  • text
  • table

Enter information and hit enter one by one like you see below.

How to Install and Configure AWS CLI on Windows 5

Let’s verify if our configuration is working fine.

Issue an s3 ls command to list all of your s3 bucket.

aws s3 ls

And tada, you see all your bucket listed like below. (The actual list will differ obviously as per buckets present in your account.)

How to Install and Configure AWS CLI on Windows 6

Congratulations !!!

You have successfully installed and configured AWS CLI v2.

3. Uninstall AWS CLI

Un-installation process is similar to any other windows program.

Go to Control Panel -> Programs and Features -> Uninstall a program

Locate AWS Command Line Interface v2.

Right Click and click on Uninstall.

Click on Yes and it will uninstall.

Conclusion

AWS CLI is really handy to deal with AWS services through a unified command line tool. In this post(How to Install and Configure AWS CLI on Windows), we downloaded the MSI installer, installed the CLI v2 and then configured the CLI with Access key and secret Key.

After the configuration, we verified by doing an s3 list bucket command and successfully verified the configuration.

I hope you found this post useful. If you have any question, please feel free to drop in comment.

Enjoyed the content?

Subscribe to our newsletter below to get awesome AWS learning materials delivered straight to your inbox.

Subscribe to our newsletter below to get awesome AWS learning materials delivered straight to your inbox.

If you are reading this, Please Please motivate me by-

Suggested Read:

Leave a Reply

Your email address will not be published. Required fields are marked *