aws configure | Configure default credentials |
aws configure --profile <name> | Configure named profile |
aws configure list | List current configuration |
aws configure list-profiles | List all profiles |
aws configure get region | Get specific config value |
aws configure set region us-east-1 | Set specific config value |
export AWS_PROFILE=<name> | Set profile via environment |
aws sts get-caller-identity | Verify current identity |
aws <command> --output json | Output as JSON |
aws <command> --output table | Output as table |
aws <command> --output text | Output as text |
aws <command> --region us-west-2 | Specify region |
aws <command> --query "Items[*].Name" | Filter with JMESPath |
aws <command> --dry-run | Test without executing |
aws ec2 describe-instances | List all instances |
aws ec2 describe-instances --instance-ids <id> | Describe specific instance |
aws ec2 describe-instances --filters "Name=tag:Name,Values=*web*" | Filter by tag |
aws ec2 run-instances --image-id <ami> --instance-type t2.micro --key-name <key> | Launch instance |
aws ec2 start-instances --instance-ids <id> | Start instance |
aws ec2 stop-instances --instance-ids <id> | Stop instance |
aws ec2 reboot-instances --instance-ids <id> | Reboot instance |
aws ec2 terminate-instances --instance-ids <id> | Terminate instance |
aws ec2 describe-security-groups | List security groups |
aws ec2 create-security-group --group-name <name> --description "<desc>" --vpc-id <vpc> | Create security group |
aws ec2 authorize-security-group-ingress --group-id <sg> --protocol tcp --port 22 --cidr 0.0.0.0/0 | Add inbound rule |
aws ec2 revoke-security-group-ingress --group-id <sg> --protocol tcp --port 22 --cidr 0.0.0.0/0 | Remove inbound rule |
aws ec2 delete-security-group --group-id <sg> | Delete security group |
aws ec2 describe-key-pairs | List key pairs |
aws ec2 create-key-pair --key-name <name> --query "KeyMaterial" --output text > key.pem | Create and save key pair |
aws ec2 delete-key-pair --key-name <name> | Delete key pair |
aws ec2 describe-images --owners self | List your AMIs |
aws ec2 create-image --instance-id <id> --name "<name>" | Create AMI from instance |
aws s3 ls | List all buckets |
aws s3 mb s3://<bucket> | Create bucket |
aws s3 rb s3://<bucket> | Remove empty bucket |
aws s3 rb s3://<bucket> --force | Remove bucket with contents |
aws s3 ls s3://<bucket> | List bucket contents |
aws s3 ls s3://<bucket> --recursive | List all objects recursively |
aws s3 cp <file> s3://<bucket>/ | Upload file to S3 |
aws s3 cp s3://<bucket>/<key> <file> | Download file from S3 |
aws s3 mv s3://<bucket>/<key> s3://<bucket>/<newkey> | Move/rename object |
aws s3 rm s3://<bucket>/<key> | Delete object |
aws s3 rm s3://<bucket>/ --recursive | Delete all objects |
aws s3 sync <dir> s3://<bucket>/ | Sync local to S3 |
aws s3 sync s3://<bucket>/ <dir> | Sync S3 to local |
aws s3 sync s3://<src> s3://<dst> | Sync between buckets |
aws s3 presign s3://<bucket>/<key> | Generate presigned URL (1hr) |
aws s3 presign s3://<bucket>/<key> --expires-in 3600 | Presigned URL with expiry |
aws iam list-users | List all users |
aws iam create-user --user-name <name> | Create user |
aws iam delete-user --user-name <name> | Delete user |
aws iam list-groups | List all groups |
aws iam create-group --group-name <name> | Create group |
aws iam add-user-to-group --user-name <user> --group-name <group> | Add user to group |
aws iam remove-user-from-group --user-name <user> --group-name <group> | Remove user from group |
aws iam list-policies --scope Local | List custom policies |
aws iam attach-user-policy --user-name <user> --policy-arn <arn> | Attach policy to user |
aws iam detach-user-policy --user-name <user> --policy-arn <arn> | Detach policy from user |
aws iam list-roles | List all roles |
aws iam create-role --role-name <name> --assume-role-policy-document file://policy.json | Create role |
aws iam attach-role-policy --role-name <role> --policy-arn <arn> | Attach policy to role |
aws iam list-access-keys --user-name <user> | List access keys |
aws iam create-access-key --user-name <user> | Create access key |
aws iam delete-access-key --user-name <user> --access-key-id <id> | Delete access key |
aws iam update-access-key --user-name <user> --access-key-id <id> --status Inactive | Deactivate access key |
aws lambda list-functions | List all functions |
aws lambda get-function --function-name <name> | Get function details |
aws lambda create-function --function-name <name> --runtime nodejs18.x --handler index.handler --zip-file fileb://code.zip --role <role-arn> | Create function |
aws lambda update-function-code --function-name <name> --zip-file fileb://code.zip | Update function code |
aws lambda update-function-configuration --function-name <name> --memory-size 256 | Update configuration |
aws lambda delete-function --function-name <name> | Delete function |
aws lambda invoke --function-name <name> output.json | Invoke function |
aws lambda invoke --function-name <name> --payload '{"key":"value"}' output.json | Invoke with payload |
aws lambda invoke --function-name <name> --invocation-type Event output.json | Async invocation |
aws logs describe-log-groups --log-group-name-prefix /aws/lambda/<name> | Get Lambda log group |
aws logs tail /aws/lambda/<name> --follow | Tail Lambda logs |
aws rds describe-db-instances | List RDS instances |
aws rds create-db-instance --db-instance-identifier <id> --db-instance-class db.t2.micro --engine mysql --master-username admin --master-user-password <pass> | Create RDS instance |
aws rds start-db-instance --db-instance-identifier <id> | Start RDS instance |
aws rds stop-db-instance --db-instance-identifier <id> | Stop RDS instance |
aws rds delete-db-instance --db-instance-identifier <id> --skip-final-snapshot | Delete RDS instance |
aws rds create-db-snapshot --db-instance-identifier <id> --db-snapshot-identifier <snap> | Create snapshot |
aws dynamodb list-tables | List tables |
aws dynamodb describe-table --table-name <name> | Describe table |
aws dynamodb scan --table-name <name> | Scan all items |
aws dynamodb get-item --table-name <name> --key '{"id":{"S":"123"}}' | Get single item |
aws dynamodb put-item --table-name <name> --item '{"id":{"S":"123"},"name":{"S":"test"}}' | Put item |
aws dynamodb delete-item --table-name <name> --key '{"id":{"S":"123"}}' | Delete item |
aws dynamodb query --table-name <name> --key-condition-expression "id = :v" --expression-attribute-values '{":v":{"S":"123"}}' | Query table |
aws cloudformation list-stacks | List all stacks |
aws cloudformation describe-stacks --stack-name <name> | Describe stack |
aws cloudformation create-stack --stack-name <name> --template-body file://template.yaml | Create stack |
aws cloudformation update-stack --stack-name <name> --template-body file://template.yaml | Update stack |
aws cloudformation delete-stack --stack-name <name> | Delete stack |
aws cloudformation describe-stack-events --stack-name <name> | View stack events |
aws cloudformation validate-template --template-body file://template.yaml | Validate template |
aws ecs list-clusters | List clusters |
aws ecs list-services --cluster <cluster> | List services |
aws ecs list-tasks --cluster <cluster> | List tasks |
aws ecs describe-services --cluster <cluster> --services <svc> | Describe service |
aws ecs update-service --cluster <cluster> --service <svc> --force-new-deployment | Force new deployment |
aws ecs update-service --cluster <cluster> --service <svc> --desired-count 3 | Scale service |