TerraformPilot

DevOps

Install AWS CLI on Windows with winget: Quick Setup Guide

Install AWS CLI v2 on Windows using winget in one command. Configure credentials, set up PowerShell autocomplete, and verify with Terraform.

LLuca Berton1 min read

winget is the built-in package manager in Windows 10/11. One command installs AWS CLI v2 — no MSI download, no browser needed.

Install with winget

#

Open PowerShell or Command Prompt:

winget install Amazon.AWSCLI

That's it. Close and reopen your terminal, then verify:

aws --version
# aws-cli/2.17.x Python/3.12.x Windows/10 exe/AMD64

Alternative: MSI Installer

#

If winget isn't available:

# Download and run the MSI
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

Or download from https://awscli.amazonaws.com/AWSCLIV2.msi and double-click.

Configure Credentials

#
aws configure
# AWS Access Key ID [None]: AKIA...
# AWS Secret Access Key [None]: ****
# Default region name [None]: us-east-1
# Default output format [None]: json

Credentials are stored in %USERPROFILE%\.aws\credentials.

Named Profiles

#
aws configure --profile production
# Use in Terraform:
$env:AWS_PROFILE = "production"
terraform plan

SSO

#
aws configure sso
aws sso login --profile my-org
$env:AWS_PROFILE = "my-org"
terraform plan

Verify

#
# Check identity
aws sts get-caller-identity
 
# List S3 buckets
aws s3 ls
 
# Terraform uses same credentials
terraform init
terraform plan

Update

#
winget upgrade Amazon.AWSCLI

Uninstall

#
winget uninstall Amazon.AWSCLI

PowerShell Autocomplete

#
# Add to $PROFILE
Register-ArgumentCompleter -Native -CommandName aws -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)
    $env:COMP_LINE = $commandAst.ToString()
    $env:COMP_POINT = $cursorPosition
    aws_completer.exe | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
    Remove-Item Env:\COMP_LINE
    Remove-Item Env:\COMP_POINT
}

Install Terraform Too

#
# While you're at it
winget install HashiCorp.Terraform
 
terraform version

Troubleshooting

#

"aws is not recognized"

#

Close and reopen your terminal after installation. If still not found:

# Check if aws.exe exists
Get-Command aws -ErrorAction SilentlyContinue
 
# Add to PATH manually if needed
$env:PATH += ";C:\Program Files\Amazon\AWSCLIV2"

"Unable to locate credentials"

#
# Verify credentials exist
aws configure list
 
# Check for environment variable overrides
Get-ChildItem env:AWS_*

winget Not Available

#

Windows 10 version 1809+ and Windows 11 include winget. If missing:

# Install from Microsoft Store: "App Installer"
# Or use the MSI method above

Hands-On Courses

#

Conclusion

#

winget install Amazon.AWSCLI is the fastest way to get AWS CLI on Windows. One command, auto-updates with winget upgrade, and credentials work automatically with Terraform. No browser download needed.

#AWS#DevOps#Installation#Windows#CLI

Share this article