AWS cheat sheet

A quick reference for AWS with the most important commands and options. Read it online below, or download the printable PDF.

Download PDF

Installation

See https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

For autocompletion see https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-completion.html.

Global flags

Flag Description
--profile <name> Run a command using the specified profile
--output <style> Format output as (json/text/table/yaml)
--help Show help
--endpoint-url <url> Override default API endpoint
--region Override default region
--version Show version of AWS CLI

Configuration

Command Description
aws configure Configure AWS
aws configure sso Configure AWS IAM Identity Center credentials
aws configure list Show current configuration data
aws configure set <key> <value> Set a configuration value
aws configure get <key> Show a configuration value

Profiles

Command Description
aws configure --profile <name> Create a new profile
aws configure list-profiles Show available profiles

Account information

Command Description
aws sts get-caller-identity Retrieve account information

Identity and Access Management (IAM)

Command Description
aws iam list-users List users
aws iam list-groups List groups
aws iam list-roles List roles
aws iam list-policies List policies
aws iam create-user --user-name <name> Create a user
aws iam create-group --group-name <name> Create a group
aws iam create-role --role-name <name> --assume-role-policy-document <policy> Create a role
aws iam create-policy --policy-name <name> --policy-document <policy> Create a policy

Elastic Compute Cloud (EC2)

Command Description
aws ec2 describe-instances List instances
aws ec2 run-instances --image-id <id> --instance-type <type> Create an instance
aws ec2 terminate-instances --instance-ids <id> Terminate an instance
aws ec2 start-instances --instance-ids <id> Start an instance
aws ec2 stop-instances --instance-ids <id> Stop an instance

Elastic Kubernetes Service (EKS)

Command Description
aws eks list-clusters List clusters
aws eks describe-cluster --name <name> Describe a cluster
aws eks create-cluster --name <name> Create a cluster
aws eks delete-cluster --name <name> Delete a cluster

Relational Database Service (RDS)

Command Description
aws rds describe-db-clusters List clusters
aws rds describe-db-instances List instances
aws rds create-db-cluster-snapshot Create a snapshot of a cluster

Simple Storage Service (S3)

Command Description
aws s3 ls List buckets
aws s3 ls s3://<bucket> List objects in a bucket
aws s3 mb s3://<bucket> Create a bucket
aws s3 rb s3://<bucket> Delete a bucket
aws s3 cp <src> <dest> Copy a file from/to S3
aws s3 rm s3://<bucket>/<object> Delete an object
aws s3 sync s3://bucket <dir> Sync a bucket to a local directory
aws s3 sync <dir> s3://bucket Sync a local directory to an S3 bucket

Other commands

Command Description
aws --version Show version
aws help Show help including all available commands
aws <command> help Show help for a specific command