AWS CLI Cheatsheet
AWS
CLI
Cloud
Infrastructure
Complete reference for AWS Command Line Interface covering EC2, S3, IAM, Lambda, VPC, RDS, CloudFront, and cloud infrastructure management.
Quick Reference
☁️ Compute & Storage
EC2 instances, EBS volumes, S3 buckets, and AMI management
🔐 Security & Identity
IAM users, roles, policies, and access management
🌐 Networking & CDN
VPC, subnets, security groups, and CloudFront
⚡ Services & Databases
Lambda functions, RDS databases, and monitoring
Getting Started
AWS CLI is a unified tool to manage your AWS services from the command line. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
AWS CLI Setup
Installation and configuration
Basic AWS CLI structure
EC2 (Elastic Compute Cloud)
EC2 provides scalable computing capacity in the cloud. Use these commands to manage instances, security groups, and key pairs.
EC2 Instances
Instance management
Instance monitoring
EBS Volumes
Volume management
Snapshots and AMIs
AMI Management
Working with AMIs
Security Groups
Security group management
S3 (Simple Storage Service)
S3 provides object storage through a web service interface. Use these commands for bucket and object management.
Bucket Operations
Bucket management
File Operations
Upload and download
File management
IAM (Identity and Access Management)
IAM enables you to manage access to AWS services and resources securely. Use these commands to manage users, groups, roles, and policies.
Users and Groups
User management
Access keys
Policies and Roles
Policy management
Role management
Lambda
AWS Lambda lets you run code without provisioning or managing servers. Use these commands to manage Lambda functions.
Function Management
Basic function operations
Function execution
Aliases and versions
VPC (Virtual Private Cloud)
VPC lets you provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network.
VPC Management
VPC operations
Subnets
Subnet management
Internet Gateway and NAT
Internet Gateway
NAT Gateway
Route Tables
Route table management
RDS (Relational Database Service)
RDS makes it easy to set up, operate, and scale a relational database in the cloud. Use these commands to manage database instances and clusters.
Database Instances
RDS instance management
Database monitoring and backups
Database Clusters
RDS cluster management
CloudFront
CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally.
Distribution Management
CloudFront operations
Content deployment workflow
Monitoring and Logs
CloudWatch provides monitoring and observability for AWS resources and applications. Use these commands to manage logs and metrics.
CloudWatch Logs
Log management
CloudWatch Metrics
Metrics and alarms
Best Practices
Follow these AWS CLI best practices for secure, efficient, and maintainable cloud operations.
- Use IAM roles instead of access keys when possible for better security
- Configure multiple profiles for different environments and accounts
- Use --dry-run flag to test commands before execution
- Implement proper tagging strategy for resource management and cost tracking
- Use CloudFormation or CDK for infrastructure as code instead of manual CLI commands
- Enable CloudTrail for auditing and monitoring API calls
- Set up billing alerts to monitor AWS costs and usage
- Use AWS CLI output filters and queries to get specific information efficiently
- Keep AWS CLI updated to access latest features and security patches
- Use specific regions to avoid unexpected costs and latency
- Enable MFA for sensitive operations and administrative access
- Regular security audits of IAM policies and access patterns
Learn More
Explore comprehensive AWS documentation and cloud infrastructure best practices
Written by
Deepak Jangra
Created At
Wed Jan 15 2025
Updated At
Fri Jun 13 2025