Learn to configure AWS CLI for secure, efficient cloud management. Follow step-by-step guidance for installation, configuration, and usage patterns.
Powerful and flexible CLI interface for managing AWS services efficiently
Access all AWS services, including EC2, S3, IAM, and more from the command line
Write automated scripts for tasks, reducing the need for manual work
Supports encrypted profiles, IAM roles, and temporary authentication
Install and configure the CLI to begin using AWS services
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip
unzip -q awscliv2.zip
sudo ./aws/install
Securely store your AWS credentials and region settings
aws configure
AWS Access Key ID: AKIAXXXXXXX
AWS Secret Access Key: 1234abcd
Default region name: us-east-1
Default output format: json
Stored at: ~/.aws/credentials (Linux/macOS) or %UserProfile%\.aws\credentials (Windows)
Full docsNamed profiles, credential providers, and role switching
aws configure set profile.prod.aws_access_key_id AKIAXXXXXXX
aws configure set profile.prod.aws_secret_access_key abcd1234
aws configure set profile.prod.region us-east-1
Usage: aws ec2 describe-instances --profile prod
aws sts assume-role --role-arn arn:aws:iam::123456789012:role/MyRole
--role-session-name TestSession
Returns temporary credentials for cross-account access
Everyday commands to get you started managing AWS infrastructure
aws ec2 describe-instances --query 'Reservations[*].Instances[*].{ID:InstanceId,Type:InstanceType}' --output table
Shows instance IDs and types in a formatted table
aws s3 cp local-file.txt s3://your-bucket
aws s3 sync . s3://your-bucket/
Upload and synchronize files with Amazon S3
aws iam list-users
aws iam create-user --user-name DevUser
List all IAM users or create new ones
aws cloudtrail describe-trails
aws cloudtrail start-logging --trail-name MyTrail
View and start auditing trail logging
The AWS CLI makes it easy to manage and automate AWS services from your terminal.