AWS CLI Cheat Sheet
# AWS CLI Cheat Sheet
## Configure
```
aws configure
aws configure set aws_access_key_id KEY
aws configure set aws_secret_access_key SECRET
```
## S3
```
aws s3 ls
aws s3 cp file.txt s3://bucket/
aws s3 sync ./dir s3://bucket/dir
aws s3 rm s3://bucket/file.txt
```
## EC2
```
aws ec2 describe-instances
aws ec2 start-instances --instance-ids i-12345
aws ec2 stop-instances --instance-ids i-12345
aws ec2 run-instances --image-id ami-xxx --instance-type t2.micro
```
## Lambda
```
aws lambda list-functions
aws lambda invoke --function-name my-func response.json
```
## IAM
```
aws iam list-users
aws iam create-user --user-name bob
aws iam attach-user-policy --user-name bob --policy-arn arn:...
```
## CloudFormation
```
aws cloudformation deploy --template-file template.yaml --stack-name mystack
aws cloudformation describe-stacks --stack-name mystack
aws cloudformation delete-stack --stack-name mystack
```