🚀 AWS CLI - 50 Most Important Commands

Most Useful & Frequently Used Commands

1. Configuration & Basics
aws configure
Set up AWS credentials, region, and output format
aws --version
Check AWS CLI version
aws configure list
Show current configuration
aws sts get-caller-identity
Show current AWS account and user details
2. S3 Commands
aws s3 ls
List all S3 buckets
aws s3 ls s3://my-bucket
List objects inside a bucket
aws s3 cp file.txt s3://my-bucket/
Upload file to S3
aws s3 cp s3://my-bucket/file.txt .
Download file from S3
aws s3 sync . s3://my-bucket/folder/
Sync local folder to S3
aws s3 sync s3://my-bucket/ .
Sync S3 bucket to local
aws s3 rm s3://my-bucket/file.txt
Delete file from S3
aws s3 mb s3://new-bucket
Create new S3 bucket
3. EC2 Commands
aws ec2 describe-instances
List all EC2 instances
aws ec2 start-instances --instance-ids i-0xxxxxxxxxxxx
Start EC2 instance
aws ec2 stop-instances --instance-ids i-0xxxxxxxxxxxx
Stop EC2 instance
aws ec2 reboot-instances --instance-ids i-0xxxxxxxxxxxx
Reboot EC2 instance
aws ec2 describe-security-groups
List security groups
aws ec2 describe-key-pairs
List key pairs
4. VPC & Networking
aws ec2 describe-vpcs
List all VPCs
aws ec2 describe-subnets
List all subnets
aws ec2 describe-route-tables
List route tables
aws ec2 describe-internet-gateways
List Internet Gateways
aws ec2 describe-nat-gateways
List NAT Gateways
aws ec2 describe-vpc-peering-connections
List VPC peering connections
5. IAM Commands
aws iam list-users
List all IAM users
aws iam list-roles
List all IAM roles
aws iam list-policies
List IAM policies
aws iam list-groups
List IAM groups
6. Lambda Commands
aws lambda list-functions
List all Lambda functions
aws lambda invoke --function-name my-function output.json
Invoke Lambda function
aws lambda get-function --function-name my-function
Get details of a Lambda function
7. RDS Commands
aws rds describe-db-instances
List all RDS instances
aws rds describe-db-clusters
List Aurora DB clusters
aws rds describe-db-snapshots
List RDS snapshots
8. EKS Commands
aws eks list-clusters
List all EKS clusters
aws eks describe-cluster --name my-cluster
Get details of an EKS cluster
aws eks list-nodegroups --cluster-name my-cluster
List node groups in EKS cluster
9. CloudWatch Commands
aws cloudwatch list-metrics
List all CloudWatch metrics
aws logs describe-log-groups
List CloudWatch Log Groups
aws logs get-log-events --log-group-name my-log-group --log-stream-name my-stream
Get log events
aws cloudwatch describe-alarms
List CloudWatch alarms
10. Other Important Commands
aws cloudformation list-stacks
List CloudFormation stacks
aws ecs list-clusters
List ECS clusters
aws dynamodb list-tables
List DynamoDB tables
aws sns list-topics
List SNS topics
aws sqs list-queues
List SQS queues
aws route53 list-hosted-zones
List Route53 hosted zones
aws s3api list-buckets
List buckets using low-level API
aws ec2 describe-volumes
List EBS volumes
aws elbv2 describe-load-balancers
List Application/Network Load Balancers