Cheatsheet
The AWS CLI commands you reach for daily, on one page.
Daily AWS
EXAMPLE
# Identity aws sts get-caller-identity aws configure list-profiles aws configure get region --profile prod # S3 aws s3 ls aws s3 ls s3://my-bucket --recursive --human-readable --summarize aws s3 cp file.txt s3://my-bucket/ aws s3 sync ./dist s3://my-bucket --delete --cache-control 'max-age=31536000' aws s3 presign s3://my-bucket/key --expires-in 3600 # EC2 aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,State.Name,Tags[?Key==\`Name\`].Value|[0]]' --output table aws ec2 stop-instances --instance-ids i-... aws ec2 start-instances --instance-ids i-... # SSM (no SSH) aws ssm start-session --target i-... aws ssm send-command --document-name AWS-RunShellScript --instance-ids i-... --parameters 'commands=["uptime"]' # Lambda aws lambda list-functions --query 'Functions[].FunctionName' --output text aws lambda invoke --function-name my-fn out.json aws logs tail /aws/lambda/my-fn --follow --since 10m # RDS aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,DBInstanceStatus,Endpoint.Address]' --output table aws rds create-db-snapshot --db-instance-identifier prod --db-snapshot-identifier prod-$(date +%s) # IAM aws iam list-users aws iam list-roles aws iam get-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess aws iam simulate-principal-policy --policy-source-arn arn:... --action-names s3:GetObject --resource-arns arn:aws:s3:::bucket/key # CloudFormation aws cloudformation deploy --stack-name foo --template-file t.yaml --parameter-overrides Foo=Bar aws cloudformation describe-stack-events --stack-name foo --max-items 20 # CloudWatch logs aws logs tail /aws/ecs/my-service --follow --since 5m --filter-pattern 'ERROR' # Secrets + SSM Parameter Store aws ssm get-parameter --name /app/prod/db --with-decryption --query Parameter.Value --output text aws secretsmanager get-secret-value --secret-id app/prod --query SecretString --output text | jq -r .password # Cost aws ce get-cost-and-usage --time-period Start=2026-06-01,End=2026-06-30 --granularity MONTHLY --metrics UnblendedCost # aws-vault for MFA-backed sessions aws-vault login prod aws-vault exec prod -- aws s3 ls # Region + profile export AWS_PROFILE=prod export AWS_REGION=ap-southeast-2 # Output formats --output json|table|text|yaml --query 'foo[].bar'
Why it matters
Use SSM Session Manager instead of SSH, use aws-vault for short-lived MFA creds, never paste long-lived keys into a shell. --query is the unsung hero - smaller, parseable output without piping into jq.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Example
Example
aws s3 ls aws ec2 describe-instances aws lambda invoke --function-name fn out.json aws logs tail /aws/lambda/fn --followTry it Yourself »
Discussion
Loading…