AWS Cheatsheet
AWS Cheatsheet
Introduction to AWS
✅ What is AWS?
● Amazon Web Services (AWS) is a secure, scalable, and cost-effective cloud computing
platform offered by Amazon.
● Launched in 2006, it provides on-demand computing resources like storage, compute
power, databases, analytics, AI, and more on a pay-as-you-go basis.
✅ Why AWS?
Feature Description
✅ AWS Regions
● Each region is completely isolated for fault tolerance.
● Regions have at least two AZs, and some regions have up to six.
● Regions are identified by codes (e.g., us-east-1 for N. Virginia).
✅ Availability Zones
● AZs are physically separated by distance to reduce failure correlation.
● Connected by low-latency, high-throughput, redundant network links.
● You can deploy across multiple AZs for high availability (HA) and fault tolerance.
12-Month Free 12 months after account Free limits apply for 1 year
creation
S3 5 GB Standard storage
DynamoDB 25 GB storage
Glacier 10 GB retrieval
📌 Tip: After 12 months, services will continue to run and start charging at standard rates
unless you delete or modify them.
✅ Instance Lifecycle
1. Pending – Starting
2. Running – Operational
3. Stopping/Stopped – Temporarily paused
4. Terminated – Deleted
✅ Pricing Models
Model Description Use Cases
● OS configuration
● Application server
● Custom software & dependencies
✅ AMI Types
Type Description
🔁 3. Auto Scaling
✅ What is Auto Scaling?
Auto Scaling automatically adjusts the number of EC2 instances in your application based on
demand.
✅ Key Concepts
Term Description
Scaling Policy Rules for scaling in/out (e.g., CPU > 80%)
✅ Key Features
Feature Description
✅ EKS Architecture
Component Description
✅ Key Features of S3
Feature Description
Object Storage Stores data as key-value pairs (objects), not
as files or blocks
✅ S3 Bucket Concepts
Term Description
✅ S3 Lifecycle Rules
Used to automate the transition of data between storage classes or deletion.
Example Rules:
{
"Rules": [
{
"ID": "TransitionRule",
"Filter": {
"Prefix": ""
},
"Status": "Enabled",
"Transitions": [
{
"Days": 30,
"StorageClass": "STANDARD_IA"
},
{
"Days": 90,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 365
}
}
]
}
✅ S3 Versioning
● Enables multiple versions of the same object
● Protects against accidental overwrites and deletions
● Can be used with MFA Delete
✅ S3 Glacier
Feature Description
S3 Glacier Low-cost, archival storage (retrieval in
minutes to hours)
✅ S3 CLI Examples
Upload a file:
aws s3 ls s3://my-bucket/
Backup Snapshots to S3
Volume Types:
📌 Important: EBS is tied to a specific AZ and EC2 instance. Not shareable across instances.
Use Cases:
🧠 Types of FSx
FSx Type Use Case Description
FSx for Windows File Microsoft workloads SMB protocol support, Active
Server Directory integration
📌 Summary Table
Service Type Best For Access
EFS File Storage (NFS) Shared storage for Mount as file system
Linux apps
Automatically created ✅ ❌
Public subnet ✅ User-defined
✅ Subnet Types
Type Internet Access Use Cases
🗺️ 3. Route Tables
Route tables define how traffic is directed within your VPC.
Example:
Destination Target
10.0.0.0/16 local
0.0.0.0/0 igw-123abc
✅ CLI Example
aws ec2 attach-internet-gateway \
--vpc-id vpc-abc123 \
--internet-gateway-id igw-xyz789
📌 NAT Gateways are recommended for production; NAT Instances for cost-sensitive dev/test
environments.
Type Stateful
Example Rule:
Scope Subnet-wide
Example Rule:
📌 Use Security Groups for most use cases; NACLs for extra layer of security.
✅ Key Benefits
● Lower latency & jitter
● Higher throughput
● Consistent network performance
● Bypasses the internet
✅ Use Cases
● Hybrid cloud
● Finance/Healthcare (compliance-heavy)
● Large data transfers
✅ Key Concepts
Concept Description
✅ Benefits
● Static IP addresses
● Automatic health checks & failover
● Improved availability and latency
🧠 Summary Table
Component Purpose Scope Stateful Public Access
✅ Supported Engines
● MySQL
● PostgreSQL
● MariaDB
● Oracle
● SQL Server
● Aurora (AWS-optimized MySQL/PostgreSQL)
✅ RDS Features
Feature Description
💡 2. Amazon Aurora
✅ What is Aurora?
Amazon Aurora is a cloud-native relational DB engine with performance and availability of
high-end commercial DBs, but at 1/10th the cost.
📒 3. Amazon DynamoDB
✅ What is DynamoDB?
A fully managed NoSQL database service that provides single-digit millisecond
performance at any scale.
✅ DynamoDB Characteristics
Property Value
✅ DynamoDB Features
Feature Description
✅ Use Cases
● Gaming leaderboards
● Shopping carts
● Serverless applications (integrates with Lambda)
🧱 4. Amazon Redshift
✅ What is Redshift?
A fully managed data warehouse designed for OLAP (Online Analytical Processing).
✅ Redshift Architecture
Feature Description
✅ Use Cases
● Business Intelligence
● Data Lakes
● Real-time Analytics
✅ Redshift vs RDS
Feature RDS Redshift
⚡ 5. Amazon ElastiCache
✅ What is ElastiCache?
A fully managed in-memory cache service to improve app performance.
Supports:
● Redis
● Memcached
✅ Use Cases
● Caching frequently accessed data
● Session stores
● Leaderboards
● Real-time analytics
✅ ElastiCache Benefits
● Sub-millisecond latency
● Reduces DB load
● Seamless scaling with clustering
🧠 Summary Table
Service Type Best For Key Feature
BI dashboard Redshift
● Users
● Groups
● Roles
● Policies
✅ IAM Users
Feature Description
🛠️ Example:
{
"UserName": "utkrist-admin",
"Permissions": ["AmazonS3FullAccess", "EC2ReadOnlyAccess"]
}
✅ IAM Groups
Feature Description
✅ IAM Roles
Feature Description
✅ IAM Policies
Policies define permissions.
Type Description
Managed Policies AWS-predefined or customer-created
🧠 Policy Format:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}]
}
🛡️ Devices:
● Virtual MFA apps (Authy, Google Authenticator)
● Hardware MFA (YubiKey)
🏢 2. AWS Organizations
✅ What is AWS Organizations?
A service to centrally manage multiple AWS accounts, ideal for:
● Enterprises
● Billing consolidation
● Policy control across accounts
✅ Key Concepts
Concept Description
✅ Use Cases
● Separate prod/dev/test environments
● Isolate billing
● Enforce compliance rules (e.g., deny EC2 in certain regions)
Feature Description
● IAM users
● Federated users
● Cross-account access
✅ Key Features
Feature Description
🛠️ Example:
aws sts assume-role \
--role-arn arn:aws:iam::111122223333:role/CrossAccountRole \
--role-session-name devSession
Manages AWS ✅ ✅ ❌
permissions
Role-based ✅ ✅ ✅
delegation
Federation support ❌ ✅ ✅
✅ Best Practices
● Enforce MFA for all users (especially root)
● Use roles for EC2, Lambda, etc. (not access keys)
● Never use root user except for billing/account setup
● Use IAM policies with least privilege
● Rotate credentials and enable access key auditing
● Apply SCPs in Organizations to enforce account-wide policies
🧠 Summary Table
Feature IAM Organizations SSO STS
User ✅ ❌ ✅ ❌
Management
Role ✅ ✅ ✅ ✅
Assumption
MFA Support ✅ ❌ ✅ ❌
Cross-Account ✅ (roles) ✅ ✅ ✅
Use Case Secure single Multi-account Unified login Temporary
account control access
📡 1. Amazon CloudWatch
✅ What is CloudWatch?
CloudWatch is a monitoring and observability service for:
● Logs
● Metrics
● Events
● Alarms
● Dashboards
🔍 A. CloudWatch Metrics
Numerical values over time, used to understand the performance of AWS services and
applications.
Type Examples
🛠️ Example:
aws cloudwatch get-metric-statistics \
--metric-name CPUUtilization \
--namespace AWS/EC2 \
--dimensions Name=InstanceId,Value=i-1234567890 \
--statistics Average \
--end-time 2025-06-06T06:00:00Z
📘 B. CloudWatch Logs
Captures real-time log streams from AWS services or custom apps.
Source Description
🧠 Supports metric filters, log retention policies, subscriptions (e.g., send to S3, Kinesis,
Lambda).
🚨 C. CloudWatch Alarms
Used to trigger actions based on metric thresholds.
🔁 Actions:
● Send SNS notification
● Trigger Lambda
📊 D. CloudWatch Dashboards
Customizable dashboards to visualize metrics and logs across AWS.
Feature Description
🕵️ 2. AWS CloudTrail
✅ What is CloudTrail?
CloudTrail records all API calls (via AWS Console, CLI, SDKs) made in your AWS account for
audit and security.
🧩 CloudTrail Components
Component Description
"eventTime": "2025-06-06T13:00:00Z",
"eventName": "StartInstances",
"userIdentity": {
"type": "IAMUser",
"userName": "utkrist"
},
"awsRegion": "us-east-1",
"sourceIPAddress": "12.34.56.78"
📤 Delivery
● Stored in S3 (optionally encrypted)
🛡️ Security
● Encrypt logs with KMS
● Apply S3 bucket policies
✅ Use Cases
Use Case How CloudTrail Helps
⚙️ 3. AWS Config
✅ What is AWS Config?
AWS Config is a resource inventory and compliance tool that records changes in resource
configurations.
🧩 Key Features
Feature Description
Resource Tracks config changes over time
Recording
✅ Use Cases
Use Case Benefit
AWS Config Compliance & drift detection Monitors config changes, evaluates
rules
📂 A. AWS CodeCommit
✅ What is CodeCommit?
A fully managed Git-based source control service that hosts secure and scalable
repositories.
Feature Details
🧱 B. AWS CodeBuild
✅ What is CodeBuild?
A fully managed CI service that compiles source code, runs tests, and produces artifacts.
Feature Description
phases:
install:
commands:
- echo Installing...
build:
commands:
- echo Building...
artifacts:
files:
- target/*.jar
🚀 C. AWS CodeDeploy
✅ What is CodeDeploy?
A deployment automation service for EC2, Lambda, or on-prem.
Mode Description
os: linux
hooks:
BeforeInstall:
- location: scripts/install.sh
🔁 D. AWS CodePipeline
✅ What is CodePipeline?
A fully managed CI/CD orchestration service to model your entire software release process.
Feature Description
💻 E. AWS Cloud9
✅ What is Cloud9?
A cloud-based IDE with support for:
● Code editing
● Debugging
Feature Description
🏗️ A. AWS CloudFormation
✅ What is CloudFormation?
Infrastructure as Code (IaC) service that helps you define and provision AWS infrastructure
using templates.
Feature Description
🧠 Sample YAML:
Resources:
MyBucket:
Type: AWS::S3::Bucket
📦 Features
● Nested stacks: Modular templates
🧩 Key Features
Tool Purpose
🛡️ Security
● Access via IAM
🧠 Tiers
Plan Access
✅ Summary Table
Tool Description Use Case
📘 A. Amazon SageMaker
✅ What is SageMaker?
A fully managed machine learning platform to build, train, and deploy ML models.
Capability Features
🧠 SageMaker Workflow
1. Prepare Data
4. Deploy
5. Monitor
📦 SageMaker Modules
Module Purpose
🖼️ B. Amazon Rekognition
✅ What is Rekognition?
A computer vision service that can identify objects, people, text, activities, and inappropriate
content in images and videos.
Feature Description
Capability Description
🗣️ D. Amazon Lex
✅ What is Lex?
A conversational AI service to build chatbots and virtual assistants using:
● Automatic Speech Recognition (ASR)
Features Description
🔊 E. Amazon Polly
✅ What is Polly?
A Text-to-Speech (TTS) service that turns text into lifelike speech using neural and standard
voices.
Feature Description
Polly Text-to-Speech
🔐 11. Security Services in AWS
Securing your cloud environment is shared responsibility: AWS secures infrastructure, you
secure your data and configurations.
Feature Description
🛡️ B. AWS Shield
✅ What is Shield?
DDoS protection for applications running on AWS.
Tier Description
🔍 C. Amazon Macie
✅ What is Macie?
A data discovery and classification tool focused on sensitive data in S3.
Feature Description
🕵️ D. Amazon GuardDuty
✅ What is GuardDuty?
A threat detection service that uses machine learning and threat intel to identify suspicious
activity.
Sources Description
Feature Description
Feature Description
Feature Description
aws configure
🔐 Profiles in CLI
Use named profiles for multiple accounts:
import boto3
session = boto3.Session(profile_name='default')
s3 = session.resource('s3')
ec2 = session.client('ec2')
3. Perform Actions
print(bucket.name)
ec2.start_instances(InstanceIds=['i-0123'])
Upload to S3 s3.Bucket('mybucket').upload_file('local.txt',
'remote.txt')
✅ boto3 vs CLI
Feature CLI boto3
🧠 Security Tips
● Always rotate IAM keys
✅ Summary
Tool Function
📚 1. Operational Excellence
Run and monitor systems to deliver business value and continually improve
processes.
Key Concepts:
🔐 2. Security
Protect data, systems, and assets using a layered approach.
Best Practices:
⚙️ 3. Reliability
Recover from failures and meet customer demands.
Techniques:
● Design for failure (multi-AZ, multi-region)
🚀 4. Performance Efficiency
Use IT and computing resources efficiently.
How:
💰 5. Cost Optimization
Avoid unnecessary costs and pay only for what you use.
Strategies:
Tactics:
● Consolidate workloads
📌 Architectural Patterns
Pattern Use
↳ S3 (Image Storage)
↳ DynamoDB (Metadata)
↓ ↓
↓ ↓
RDS (Multi-AZ)
S3 (Static Assets)
CloudWatch (Monitoring)
✅ Best Practices Summary
Area Best Practice
🔧 Tools to Help
Tool Purpose
🧠 Pro Tips
● Always use multiple Availability Zones for high availability.
● For compliance-heavy apps, use Control Tower, Organizations, and Service Control
Policies (SCPs).
📦 Wrapping Up
Domain Purpose