How to use the AWS CLI Cheat Sheet
- 1. Search or browseType what you want to do, or pick one section of the AWS CLI cheat sheet.
- 2. CopyEvery entry has its own Copy button, so it goes straight into your editor or notes.
- 3. DownloadSave the whole AWS CLI cheat sheet as plain text or Markdown for offline revision.
What's in it
Commands are for AWS CLI version 2, the current major version. Bucket names, IDs and account numbers are placeholders to replace with your own. The 34 commands are organised into 10 sections: Setup & identity, S3, EC2, IAM, Lambda, Logs & monitoring, Infrastructure, Containers, Secrets, Help.
Each AWS service and command name was checked against the AWS CLI's built-in help.
Example
List only the useful bits of your instances: aws ec2 describe-instances --query "Reservations[].Instances[].[InstanceId,State.Name,PublicIpAddress]" --output table. The --query part is JMESPath. It walks into Reservations, then Instances, and picks three fields from each, so you get a neat three-column table instead of hundreds of lines of JSON.
Tips for using it
- Run
aws sts get-caller-identitybefore anything destructive to be sure you're in the right account. - Prefer
aws configure ssoor roles over long-lived access keys on laptops. - Add --dryrun to s3 cp, sync and rm to see what would happen first.
A quick look, one entry per section
- Setup & identity:
aws configure(set access key, secret, default region and output format) - S3:
aws s3 ls s3://my-bucket/reports/(list objects under a prefix) - EC2:
aws ec2 describe-instances --filters Name=instance-state-name,Values=running(running instances) - IAM:
aws iam list-users(list IAM users) - Lambda:
aws lambda list-functions --query "Functions[].FunctionName"(function names) - Logs & monitoring:
aws logs tail /aws/lambda/hello --follow(stream CloudWatch logs (CLI v2)) - Infrastructure:
aws cloudformation deploy --template-file stack.yaml --stack-name app --capabilities CAPABILITY_IAM(create or update a CloudFormation stack) - Containers:
aws ecr get-login-password | docker login --username AWS --password-stdin 123456789012.dkr.ecr.ap-south-1.amazonaws.com(log Docker in to your ECR registry) - Secrets:
aws secretsmanager get-secret-value --secret-id prod/db --query SecretString --output text(read a secret's value)
Search the box above for the rest of the AWS CLI entries, or download the full sheet.
Frequently asked questions
Were the commands checked?
Each service and command name was checked against the AWS CLI's built-in help. Two v2-only commands, configure sso and logs tail, are marked in their descriptions.
Why ap-south-1?
It is the Mumbai region, a common choice for apps serving users in India. Use whichever region you deploy to.
Is the AWS CLI cheat sheet free?
Yes. You can search, read and copy every entry in the AWS CLI cheat sheet without signing up. The first time you download it, we ask once for your name and WhatsApp number; after that downloads and every other Uncodemy tool open straight away.