AWS CLI CHEAT SHEET

Amazon Web Services Command Line
v1.0
Configuration
  • aws configureSet credentials
  • aws configure listShow config
  • --profile nameUse profile
  • --region us-east-1Set region
  • --output jsonOutput format
S3 Commands
  • aws s3 lsList buckets
  • aws s3 ls s3://bucketList objects
  • aws s3 cpCopy file
  • aws s3 mvMove file
  • aws s3 rmDelete file
  • aws s3 syncSync directories
  • aws s3 mbMake bucket
EC2 Commands
  • describe-instancesList instances
  • start-instancesStart instance
  • stop-instancesStop instance
  • terminate-instancesTerminate
  • describe-vpcsList VPCs
  • describe-security-groupsList SGs
Lambda Commands
  • list-functionsList functions
  • invokeInvoke function
  • create-functionCreate function
  • update-function-codeUpdate code
  • get-functionGet details
S3 Examples
# Upload file to S3 aws s3 cp file.txt s3://my-bucket/ # Download from S3 aws s3 cp s3://my-bucket/file.txt ./ # Sync local folder to S3 aws s3 sync ./local-folder s3://my-bucket/remote-folder # Copy with ACL aws s3 cp file.txt s3://bucket/ --acl public-read # List with recursive aws s3 ls s3://bucket/ --recursive --human-readable
EC2 Examples
# List all instances aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,State.Name,Tags[?Key==`Name`].Value|[0]]' --output table # Start instance by ID aws ec2 start-instances --instance-ids i-0123456789abcdef0 # Filter by tag aws ec2 describe-instances --filters "Name=tag:Environment,Values=production" # Get public IPs aws ec2 describe-instances --query 'Reservations[*].Instances[*].PublicIpAddress'
IAM Commands
  • list-usersList IAM users
  • list-rolesList roles
  • create-userCreate user
  • attach-user-policyAttach policy
  • get-userGet user info
ECR Commands
  • get-login-passwordGet Docker login
  • create-repositoryCreate repo
  • describe-repositoriesList repos
  • describe-imagesList images
Query & Filter
# JMESPath query syntax --query 'Items[*].{Name:name,ID:id}' # Filter by specific values --filters "Name=instance-state-name,Values=running" # Output formats --output json | table | text | yaml # Pagination --max-items 100 --starting-token TOKEN
RDS Commands
  • describe-db-instancesList databases
  • create-db-instanceCreate DB
  • stop-db-instanceStop DB
  • start-db-instanceStart DB
CloudWatch Logs
  • describe-log-groupsList log groups
  • filter-log-eventsSearch logs
  • tail-log-eventsTail logs
  • put-log-eventsWrite logs

Perf Containers

JMeter, k6 and Gatling images with 17 protocols already built in.

All 51 cheat sheets

Free to read and free to print — no signup. Want them as A4 PDFs you can print? Get all 51 as a PDF bundle for £14.99.
A Martkos IT reference sheet · Blog · Free tools