Skip to Content

Cost Optimization Fundamentals

When to use

Reduce AWS spend without dropping durability or performance.

Analogy

AWS cost optimization is grocery shopping on a budget - buy in bulk (Savings Plans), freeze long-term (Reserved Instances), throw out spoiled food (Lifecycle rules).

Data-flow diagram

  Instance family: pick by workload shape
    - general: m6i (balanced)
    - compute: c6i (CPU-heavy)
    - memory:  r6i (RAM-heavy)
    - burstable: t4g (low baseline, bursts)
  Pricing model:
    On-Demand          (highest per hour)
    Reserved 1y/3y     (1y: ~30% off, 3y: ~60% off)
    Savings Plans      (flexible across family)
    Spot               (up to 90% off, can be reclaimed)

Deep explanation

Five levers: (1) Right-sizing (Compute Optimizer); (2) Pricing models - On-Demand most flexible, Reservations/Savings Plans trade flexibility for discount (1y ~30%, 3y ~60%), Spot up to 90% off but reclaimable; (3) Storage class via S3 lifecycle; (4) Data transfer (inter-AZ / inter-Region costs); (5) Idle resources - un-attached EBS, unused Elastic IPs, unused load balancers, idle RDS instances.

Examples

Example 1

aws ce create-cost-category --name tag-compliance

groups costs by tag (env, team). Cost Explorer can slice by team.

Example 2

aws budgets create-budget --account-id 1234 \
  --budget file://budget.json

creates a monthly budget with alert thresholds (80%, 100%); SNS notifies on breach.

Example 3

aws ec2 describe-volumes \
  --filters Name=status,Values=available \
  --query 'Volumes[].[VolumeId,Size]'

finds un-attached EBS volumes charging $0.10/GB-month for nothing.

Common mistake

Running m5.xlarge 24/7 for a 1h/week workload. Releasing an un-tagged S3 bucket that quietly grew to 50 TB. Using inter-Region replication when same-Region works.

Key takeaway

tag everything; enable Cost Allocation tags; Savings Plans (3y ~60% off) for steady workloads; right-size with Compute Optimizer; S3 Intelligent-Tiering; consider Spot for stateless workloads.

Production Failure Playbook

Failure scenario 1: un-tagged-surprise-bill

Failure scenario 2: reserved-instances-wrong-family