Installing AWS CLI on Windows

How to Install and Configure AWS CLI on Windows

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
AWS CLI Install Windows

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.

Check AWS CLI Version Windows

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.

AWS IAM Users

Click on the Security Credentials tab within the user properties.

AWS IAM User Creds

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.

AWS IAM User Access 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

AWS CLI Check Version in PowerShell

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.

AWS sts-get-caller-identity

Comments

One response to “How to Install and Configure AWS CLI on Windows”

  1. […] authenticated to your AWS Account and have AWS CLI installed. I cover this in previous blog posts:# How to Install and Configure AWS CLI on Windows# How to Install and Configure AWS CLI on […]

Leave a Reply

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