← Back to Home

AWS CLI Cheat Sheet

Essential Amazon Web Services CLI commands

aws configure
Configure AWS CLI with credentials and default settings. Sets up access key, secret key, region, and output format.

aws configure

Keywords: configure, credentials, setup, access, key

aws configure list
Display current AWS CLI configuration settings. Shows configured profiles and their settings.

aws configure list

Keywords: configure, list, settings, profile, current

aws sts get-caller-identity
Get details about the current AWS identity. Shows user ID, account, and ARN.

aws sts get-caller-identity

Keywords: identity, user, account, arn, whoami

aws s3 ls
List S3 buckets or objects. Use bucket name to list objects within a specific bucket.

aws s3 ls s3://my-bucket/

Keywords: s3, list, buckets, objects, storage

aws s3 cp
Copy files to/from S3. Use --recursive for directories, --exclude/--include for filtering.

aws s3 cp file.txt s3://my-bucket/

Keywords: s3, copy, upload, download, files

aws s3 sync
Synchronize directories with S3. Only transfers changed files, supports deletion with --delete.

aws s3 sync ./local-folder s3://my-bucket/folder/

Keywords: s3, sync, synchronize, directory, backup

aws ec2 describe-instances
List EC2 instances with details. Use --filters to narrow results, --query for specific fields.

aws ec2 describe-instances --filters 'Name=instance-state-name,Values=running'

Keywords: ec2, instances, describe, list, running

aws ec2 start-instances
Start stopped EC2 instances. Provide instance IDs to start specific instances.

aws ec2 start-instances --instance-ids i-1234567890abcdef0

Keywords: ec2, start, instances, power, on

aws ec2 stop-instances
Stop running EC2 instances. Use --force for immediate shutdown without graceful stop.

aws ec2 stop-instances --instance-ids i-1234567890abcdef0

Keywords: ec2, stop, instances, shutdown, power

aws lambda list-functions
List all Lambda functions in the region. Shows function names, runtime, and last modified date.

aws lambda list-functions

Keywords: lambda, functions, list, serverless, runtime

aws lambda invoke
Invoke a Lambda function. Use --payload for input data, --log-type Tail to see logs.

aws lambda invoke --function-name my-function --payload '{}' response.json

Keywords: lambda, invoke, execute, function, payload

aws logs describe-log-groups
List CloudWatch log groups. Use --log-group-name-prefix to filter by name prefix.

aws logs describe-log-groups --log-group-name-prefix '/aws/lambda/'

Keywords: logs, cloudwatch, groups, describe, list

aws logs tail
Stream log events from CloudWatch Logs. Use --follow for continuous streaming.

aws logs tail /aws/lambda/my-function --follow

Keywords: logs, tail, stream, follow, cloudwatch

aws iam list-users
List IAM users in the account. Shows usernames, creation date, and path.

aws iam list-users

Keywords: iam, users, list, identity, access

aws iam create-user
Create a new IAM user. Use --path to organize users in groups.

aws iam create-user --user-name new-user

Keywords: iam, create, user, identity, new

aws cloudformation list-stacks
List CloudFormation stacks. Use --stack-status-filter to filter by status.

aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE

Keywords: cloudformation, stacks, list, infrastructure, status

aws cloudformation deploy
Deploy CloudFormation stack from template. Creates or updates stack with change sets.

aws cloudformation deploy --template-file template.yaml --stack-name my-stack

Keywords: cloudformation, deploy, stack, template, infrastructure

aws rds describe-db-instances
List RDS database instances. Shows instance details, status, and endpoint information.

aws rds describe-db-instances

Keywords: rds, database, instances, describe, list

aws secretsmanager get-secret-value
Retrieve secret value from AWS Secrets Manager. Use --secret-id to specify the secret.

aws secretsmanager get-secret-value --secret-id my-secret

Keywords: secrets, manager, get, value, retrieve

aws --profile
Use specific AWS profile for command. Allows switching between different AWS accounts/roles.

aws --profile production s3 ls

Keywords: profile, account, switch, credentials, role