DM
Technical reference

AWS Cheatsheet

Core cloud services and production patterns

Must Know

Core Service Map

Compute: EC2, Lambda, ECS
Storage: S3
Database: RDS, DynamoDB
Network: VPC, Route 53, CloudFront
Observability: CloudWatch
bash

AWS CLI

Use profiles instead of repeatedly changing credentials.

aws configure
aws sts get-caller-identity
aws s3 ls
aws logs tail /aws/lambda/my-function --follow

Important Patterns

json

Least-Privilege IAM

Grant only the actions and resources a workload needs.

{
  "Effect": "Allow",
  "Action": ["dynamodb:GetItem"],
  "Resource": "arn:aws:dynamodb:REGION:ACCOUNT:table/Users"
}
javascript

Lambda Handler

Keep handlers small, idempotent, and safe to retry.

export const handler = async (event) => {
  return { statusCode: 200, body: JSON.stringify({ ok: true }) };
};

Useful Recipes

DynamoDB Key Design

Design access patterns before creating the table.

PK: USER#123
SK: PROFILE
GSI1PK: EMAIL#user@example.com
javascript

S3 Presigned Upload

Use short-lived URLs and validate content type and size.

const command = new PutObjectCommand({ Bucket, Key, ContentType });
const url = await getSignedUrl(s3, command, { expiresIn: 300 });

Pitfalls & Production

Cost Controls

Set cost alerts before shipping.

Budgets + alerts
Log retention
S3 lifecycle rules
Right-size compute
Tag every resource

Reliability

Assume network calls and event delivery can fail or repeat.

timeouts < upstream timeout
exponential backoff + jitter
DLQ for failed events
idempotency keys