☁️

AWS CLI Cheat Sheet

Configure credentials, STS, S3, EKS, and common debugging.

Related: aws-cli · terraform · kubernetes

Auth & identity

CommandDescription
aws configure listShow active credentials source
aws sts get-caller-identityVerify who you are
aws sts assume-role --role-arn arn:aws:iam::123:role/Deploy --role-session-name ciAssume IAM role
export AWS_PROFILE=myprofileSwitch profile

S3 & EKS

CommandDescription
aws s3 ls s3://my-bucket/List bucket
aws s3 sync ./dist s3://my-bucket/app/Upload directory
aws eks update-kubeconfig --name my-cluster --region us-east-1Merge EKS into kubeconfig
aws eks describe-cluster --name my-cluster --query cluster.statusCluster status

Debug

CommandDescription
aws ec2 describe-instances --filters Name=tag:Name,Values=webFind instances by tag
aws logs tail /aws/lambda/my-fn --followStream CloudWatch logs
aws cloudformation describe-stacks --stack-name my-stackStack status