Skip to main content

AWS cheatsheet

A one-page reference for AWS. For the shared responsibility model, architecture patterns, and exam-style gotchas, see the complete guide.

๐Ÿ“– Full guide: AWS โ†’

Core computeโ€‹

ServiceUse for
EC2full-control VMs
Lambdaevent-driven, short-lived functions
ECScontainers, AWS-native orchestration
EKScontainers, managed Kubernetes

S3 storage classesโ€‹

Standard          โ†’ frequent access
Standard-IA โ†’ infrequent, ms retrieval
Glacier Instant โ†’ archive, ms retrieval
Glacier Flexible โ†’ archive, minutes-hours
Glacier Deep Archive โ†’ archive, ~12h, cheapest

VPC basicsโ€‹

VPC โ†’ Subnets (per AZ) โ†’ Route Tables
Public subnet: route 0.0.0.0/0 โ†’ Internet Gateway
Private subnet: route 0.0.0.0/0 โ†’ NAT Gateway

Security Groups: stateful, allow-only, instance-level. NACLs: stateless, allow+deny, subnet-level.

IAM essentialsโ€‹

{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::my-bucket/*"
}

Least privilege: start from zero, add only what's used. Trust policy = who can assume the role; permission policy = what the role can do.

RDS vs DynamoDBโ€‹

RDSDynamoDB
Modelrelationalkey-value/document
Scalingvertical (+ read replicas)horizontal, near-infinite
Best forjoins, transactionshigh-throughput, simple access patterns

High availabilityโ€‹

ALB/NLB โ†’ Auto Scaling Group โ†’ EC2 (Multi-AZ)

Multi-AZ: automatic failover within a region. Multi-Region: DR, higher RTO, needs active data replication.

AWS CLI essentialsโ€‹

aws configure                      # access key + secret + region
aws sts get-caller-identity # who am I
aws s3 ls s3://my-bucket
aws ec2 describe-instances \
--query 'Reservations[].Instances[].InstanceId'
aws sso login --profile my-sso

Assuming rolesโ€‹

aws sts assume-role \
--role-arn arn:aws:iam::123456789012:role/Deploy \
--role-session-name deploy-session

~/.aws/config (profiles, region) vs ~/.aws/credentials (keys) โ€” two files, two purposes.

Cost optimizationโ€‹

  • Right-size EC2/RDS instances against actual utilization.
  • Reserved/Savings Plans for steady-state workloads; Spot for interruptible.
  • S3 lifecycle rules to auto-tier cold data to Glacier.
  • Delete unattached EBS volumes and idle load balancers.

Common gotchasโ€‹

  • Security Group changes are instant; NACL rule order matters (evaluated in order).
  • S3 bucket names are globally unique across all AWS accounts.
  • Lambda cold starts โ€” mitigate with provisioned concurrency for latency-sensitive paths.
  • IAM policy evaluation: explicit Deny always wins over Allow.
See: Common Exam & Interview Gotchas