AWS

AWS CLI Cheatsheet

Common AWS CLI commands for S3, EC2, IAM, and other AWS services.

19 commands
Windows MacOS Linux
#cloud #amazon #infrastructure

Configuration

Configure credentials
aws configure
List current config
aws configure list
Verify credentials
aws sts get-caller-identity

S3 Commands

List buckets
aws s3 ls
List bucket contents
aws s3 ls s3://bucket-name
Upload file
aws s3 cp file s3://bucket/
aws s3 cp s3://bucket/file . # Download file
Sync directory
aws s3 sync . s3://bucket/
Delete file
aws s3 rm s3://bucket/file

EC2 Commands

List instances
aws ec2 describe-instances
aws ec2 start-instances --instance-ids <id>
aws ec2 stop-instances --instance-ids <id>
aws ec2 describe-security-groups

IAM Commands

List IAM users
aws iam list-users
List IAM roles
aws iam list-roles
Get current user
aws iam get-user

Quick Commands

Sync local directory to S3 bucket
aws s3 sync . s3://bucket/
List all EC2 instances
aws ec2 describe-instances
Verify AWS credentials
aws sts get-caller-identity