☁️
AWS CLI Cheat Sheet
Configure credentials, STS, S3, EKS, and common debugging.
Related: aws-cli · terraform · kubernetes
Auth & identity
| Command | Description | |
|---|---|---|
aws configure list | Show active credentials source | |
aws sts get-caller-identity | Verify who you are | |
aws sts assume-role --role-arn arn:aws:iam::123:role/Deploy --role-session-name ci | Assume IAM role | |
export AWS_PROFILE=myprofile | Switch profile |
S3 & EKS
| Command | Description | |
|---|---|---|
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-1 | Merge EKS into kubeconfig | |
aws eks describe-cluster --name my-cluster --query cluster.status | Cluster status |
Debug
| Command | Description | |
|---|---|---|
aws ec2 describe-instances --filters Name=tag:Name,Values=web | Find instances by tag | |
aws logs tail /aws/lambda/my-fn --follow | Stream CloudWatch logs | |
aws cloudformation describe-stacks --stack-name my-stack | Stack status |