AWS
The AWS CLI commands for identity, storage, servers, networks, databases and clean-up, with the options you forget.
Set up and identity
aws configureSave an access key, secret, default Region and output format
aws configure --profile devKeep a second set of credentials under a name
aws sts get-caller-identityShow the account and identity behind the credentials
aws <service> <command> --profile dev --region eu-west-1Choose a profile and Region for one command
aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId" --output textUse --query (JMESPath) and --output to shape the answer
IAM
aws iam create-user --user-name aliceCreate a user
aws iam attach-user-policy --user-name alice --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccessAttach a managed policy
aws iam create-access-key --user-name aliceMake a key pair (shown once: store it safely)
aws iam list-attached-user-policies --user-name aliceSee what a user is allowed
aws iam simulate-principal-policy --policy-source-arn ARN --action-names s3:GetObjectTest whether a policy allows an action
S3
aws s3 mb s3://my-unique-bucket-123Make a bucket (names are global)
aws s3 cp file.txt s3://my-unique-bucket-123/Upload a file
aws s3 sync ./site s3://my-unique-bucket-123 --deleteMake the bucket match a folder
aws s3 ls s3://my-unique-bucket-123 --recursive --human-readableList objects with sizes
aws s3api put-bucket-versioning --bucket B --versioning-configuration Status=EnabledKeep old versions of objects
aws s3 rb s3://my-unique-bucket-123 --forceDelete a bucket and everything in it
EC2
aws ec2 run-instances --image-id ami-0abc --instance-type t3.micro --key-name mykeyLaunch an instance
aws ec2 describe-instances --filters Name=instance-state-name,Values=runningList running instances
aws ec2 stop-instances --instance-ids i-0123Stop (start-instances starts it again)
aws ec2 terminate-instances --instance-ids i-0123Delete an instance for good
aws ec2 create-tags --resources i-0123 --tags Key=Env,Value=devTag a resource (tags drive cost reports)
aws ec2 create-security-group --group-name web --description "web" --vpc-id vpc-0abcCreate a firewall group
aws ec2 authorize-security-group-ingress --group-id sg-0abc --protocol tcp --port 443 --cidr 0.0.0.0/0Open a port
VPC and networking
aws ec2 create-vpc --cidr-block 10.0.0.0/16Create a private network
aws ec2 create-subnet --vpc-id vpc-0abc --cidr-block 10.0.1.0/24 --availability-zone eu-west-1aAdd a subnet in one zone
aws ec2 create-internet-gatewayA door to the internet (then attach it to the VPC)
aws ec2 create-route --route-table-id rtb-0abc --destination-cidr-block 0.0.0.0/0 --gateway-id igw-0abcSend internet traffic through the gateway
Databases, volumes and monitoring
aws ec2 create-volume --size 10 --availability-zone eu-west-1aCreate an EBS volume (attach it in the same zone)
aws rds describe-db-instances --query "DBInstances[].DBInstanceIdentifier"List databases
aws rds delete-db-instance --db-instance-identifier db1 --skip-final-snapshotDelete a database without a last snapshot
aws cloudwatch put-metric-alarm --alarm-name cpu-high --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 300 --threshold 80 --comparison-operator GreaterThanThreshold --evaluation-periods 2Alarm on high CPU
aws sns create-topic --name alertsA topic that alarms can notify
Cost and clean-up
Everything you create can cost money. Delete it when you are done.
aws budgets describe-budgets --account-id 123456789012List your budgets
aws ce get-cost-and-usage --time-period Start=2026-10-01,End=2026-10-20 --granularity DAILY --metrics UnblendedCostCost per day (each call is billed)
aws resourcegroupstaggingapi get-resources --tag-filters Key=Env,Values=devFind everything with a tag
aws cloudformation delete-stack --stack-name demoDelete a stack and all it created
Nothing matches that search.
Cheatsheet for the AWS path · Deboistech · All cheatsheets