A
cd ..
DevOps

AWS CLI Essentials

Manage AWS resources from the command line with aws cli.

2025-09-28
aws, cloud, cli

Configure AWS CLI

aws configure

List S3 buckets

aws s3 ls

List bucket contents

aws s3 ls s3://my-bucket

Upload file to S3

aws s3 cp file.txt s3://my-bucket/

Download file from S3

aws s3 cp s3://my-bucket/file.txt ./

Sync directory to S3

aws s3 sync ./local-dir s3://my-bucket/remote-dir

Delete S3 object

aws s3 rm s3://my-bucket/file.txt

List EC2 instances

aws ec2 describe-instances

List running EC2 instances

aws ec2 describe-instances --filters "Name=instance-state-name,Values=running"

Start EC2 instance

aws ec2 start-instances --instance-ids i-1234567890abcdef0

Stop EC2 instance

aws ec2 stop-instances --instance-ids i-1234567890abcdef0

Create EC2 key pair

aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem

List security groups

aws ec2 describe-security-groups

List VPCs

aws ec2 describe-vpcs

List Lambda functions

aws lambda list-functions

Invoke Lambda function

aws lambda invoke --function-name my-function output.txt

List RDS instances

aws rds describe-db-instances

Create RDS snapshot

aws rds create-db-snapshot --db-snapshot-identifier my-snapshot --db-instance-identifier my-db

List CloudWatch logs

aws logs describe-log-groups

Tail CloudWatch logs

aws logs tail /aws/lambda/my-function --follow

List IAM users

aws iam list-users

Get caller identity

aws sts get-caller-identity

List regions

aws ec2 describe-regions --output table

Use specific profile

aws s3 ls --profile production

Use specific region

aws ec2 describe-instances --region us-west-2

Output as JSON (default)

aws s3 ls --output json

Output as table

aws ec2 describe-instances --output table

Was this useful?

Share with your team

Browse More