AWS CLI Documentation

Comprehensive guides, command references, and best practices for the AWS command line interface.

Installation Guide

Install AWS CLI on your operating system of choice

Linux

curl "https://awscli.amazonaws.com/AWSCLIV2-linux-x86_64.zip" -o "awscliv2.zip"
unzip awsawscliv2.zip
sudo ./aws/install
View Details →

macOS

curl "https://awscli.amazonaws.com/AWSCLIV2-macos-x86_64.zip" -oawscliv2.zip
unzip awscliv2.zip
./aws/install
View Details →

Windows

msiexec /i AWScliv2.msi
View Details →

Configure Your CLI

Set up credentials, regions, and default formats

AWS Credentials

aws configure
Enter AWS Access Key ID: [YOUR-AKID]
Enter aws Secret Access Key: [YOUR-SECRET]
Enter default region: us-east-1
Enter default output format: json

Store credentials in ~/.aws/credentials and configuration in ~/.aws/config. Use aws configure list to verify your settings.

Advanced Profiles

Create profile: aws configure --profile dev
Use profile: aws configure set default.profile dev

Manage multiple environments with named profiles in ~/.aws/credentials. Switch profiles using AWS CLI_PROFILE=dev aws s3 ls

CLI Command Reference

Commonly used AWS CLI commands and their usage

List Resources

aws ec2 describe-instances --query 'Reservations[*].Instances[*].{ID:InstanceId,Type:InstanceType}' --output table

Use JmesPath queries to extract specific fields from JSON outputs

Upload to S3

aws s3 cp myfile.txt s3://my-bucket/docs/ --recursive

Recursive uploads to S3 with progress tracking

CloudFront Invalidation

aws cloudfront create-invalidation --distribution-id DISTRIBUTION_ID --paths '/*'

Invalidate CloudFront cache to push new content

Frequently Asked Questions

Common questions about AWS CLI usage

If not configured, the default output format is 'json'. You can change it with aws configure set default.output text or specify on command line with --output. Supported formats: json, text, table, yaml.

Service Integration

AWS CLI works with all major AWS services

Compute Services

aws ec2, aws lambda, and other compute commands for instance and function management

View Compute Docs →

Storage Services

aws s3, aws ebs, and storage management through CLI commands

View Storage Docs →

Security Services

aws iam, aws signer, and other security-related commands

View Security Docs →

Ready to Automate Your AWS Workloads?

The AWS CLI is completely free to use and integrates across all AWS services.