What is AWS CLI?

The AWS Command Line Interface (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.

Versions of AWSCLI:

Version 1.x : The generally available version of AWS CLI, Which can be used in Production environments.

Version 2.x : This is the preview version of AWS CLI which is suitable to be used in Testing Environments.

Example:

Here is the command which is used to copy files from local machine to S3 bucket using AWS CLI.

aws s3 cp filename s3://bucketname/

Installing AWS CLI on Windows

The AWS CLI can be installed in windows opearating system using Standalone installer or pip , which is a package manager for python.

Method 1 : Installing using .msi Installer

We can easily install the aws command line tool in windows by just downloading the .msi installer without any additional packages.

Download the appropriate packages for your operating system.

For Windows 64-bit OS

https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi

For Windows 32-bit OS

https://s3.amazonaws.com/aws-cli/AWSCLI32PY3.msi

Once the .msi installed is downloaded.

AWS CLI

Run the .msi installer you have downloaded, Click Run , You should see the following screen , Click Next

AWS CLI

Accept the License Agreement and click Next (twice)

AWS CLI

And then click Install

AWS CLI

Finally Click Finish.

AWS CLI

Once the package is installed , Lets verify the installation of the AWS CLI.

Open the command prompt or powershell and then run the below command.

aws --version

You should get the response as shown below.

AWS CLI

Now that we have successfully installed AWS CLI on the windows operating system and verified the same.

Method 2 : Installing AWS CLI on Windows using pip

To install the AWS CLI , command line tool using pip , First we need to install Python package if it is not already installed.

You can download the latest version of python using the below link

https://www.python.org/downloads/windows/

Once the executable installer is downloaded , Click Run

AWS CLI

Check Add Python to the PATH and then click Install Now

AWS CLI

The installation process starts,

AWS CLI

Now the installation should be Successful, To verify the installation of python , Open the command prompt.

Run the below command,

python --version

The python is successfully installed.

Now lets install the AWS CLI using pip.

pip3 install awscli

I have used pip3 to install aws cli , As we have installed python version 3.8

AWS CLI

AWS CLI

Now that we have installed aws cli using pip.

To verify the installation of aws cli , Run the below command.

aws --version

Configure AWS CLI:

Now we have to configure awscli , For that we need AWS access_key and secret_key. If you dont have, You can go ahead and create it under an IAM users.

To do so, Login to IAM Console,

IAM CONSOLE

Choose Users, Click Add user to create new user,

AWS CLI

provide a IAM user name and choose programmatic access.

AWS CLI

Click Next:Permissions , Choose Attach existing policies directly and provide S3 bucket full access to this user.

AWS CLI

And then click Create user

You will provided access_key and secret_access_key

AWS CLI

You can also download as .csv.

Now run the following command on the command prompt to configure AWS CLI,

aws configure

It will access for ACCESS_KEY , SECRET_KEY and AWS_REGION.

AWS CLI

AWS CLI is configured.

You can find the .aws/credentials file in the users home directory.

Now you should be able to access and manage the AWS services using command line interface , AWS CLI

Conclusion

We have successfully installed and configured AWS CLI using installer and the pip.

Hope you find it helpful.

Please do check out my other articles.