Back to blog
5 min read

AWS Cost Optimization: 6 Strategies That Actually Work

Practical cost reduction strategies for AWS workloads - from Reserved Instances to automated resource cleanup. Based on real production environments.

AWSCost Optimization

AWS bills can spiral out of control fast. After helping organizations cut their cloud spend by 30-50%, these are the strategies that consistently deliver results.

Reserved Instances for Predictable Workloads

Reserved Instances (RIs) offer up to 75% savings on EC2 and RDS compared to on-demand pricing. The catch: you're committing to one or three years.

When to use RIs:

  • Production databases that run 24/7
  • Baseline application servers with consistent load
  • Long-running batch processing systems

Implementation approach:

  1. Pull 3-6 months of usage data from Cost Explorer
  2. Identify instances running at 70%+ utilization consistently
  3. Start with Standard RIs for stable workloads
  4. Use Convertible RIs when you anticipate architecture changes

Monitor RI utilization monthly. Unused reservations are wasted money.

Cost Explorer: Your First Line of Defense

Cost Explorer reveals spending patterns that aren't obvious from monthly bills. Set it up properly:

Essential reports to create:

  • Daily costs by service (catch anomalies early)
  • Costs by linked account (identify runaway accounts)
  • Costs by tag (attribute spending to teams/projects)

Pro tip: Enable cost anomaly detection. AWS will alert you when spending deviates from historical patterns - often catching issues before they become expensive.

Auto Scaling Done Right

Auto Scaling prevents overprovisioning, but misconfigured scaling policies waste money or cause outages.

Scaling policy checklist:

  • Set minimum instances based on your baseline traffic
  • Use target tracking scaling with 60-70% CPU target
  • Configure scale-in cooldown to prevent thrashing
  • Test your scaling policies before production deployment
# Example target tracking policy
TargetTrackingScalingPolicy:
  TargetValue: 65.0
  PredefinedMetricType: ASGAverageCPUUtilization
  ScaleInCooldown: 300
  ScaleOutCooldown: 60

Savings Plans vs Reserved Instances

Savings Plans offer more flexibility than RIs with similar discounts (up to 72%).

Choose Compute Savings Plans when:

  • Running diverse workloads across regions
  • Using both EC2 and Fargate
  • Planning infrastructure changes

Choose EC2 Instance Savings Plans when:

  • Workloads are stable and well-understood
  • Maximum discount is priority
  • Instance families won't change

Calculate your commitment carefully. Over-committing locks you into paying for capacity you don't use.

CloudWatch Alarms for Cost Control

Set billing alarms before costs become problems:

aws cloudwatch put-metric-alarm \
  --alarm-name "Monthly-Bill-Threshold" \
  --metric-name EstimatedCharges \
  --namespace AWS/Billing \
  --statistic Maximum \
  --period 21600 \
  --threshold 1000 \
  --comparison-operator GreaterThanThreshold \
  --alarm-actions arn:aws:sns:us-east-1:ACCOUNT:billing-alerts

Beyond billing, monitor resource utilization:

  • EC2 instances under 10% CPU for extended periods
  • RDS instances with minimal connections
  • EBS volumes with zero IOPS

Automated Resource Cleanup

Unused resources accumulate fast. Automate their removal:

High-impact targets:

  • Unattached EBS volumes (charged even when not mounted)
  • Old EBS snapshots (often forgotten after AMI creation)
  • Idle Elastic IPs (charged when not associated)
  • Unused NAT Gateways ($32/month each)

Lambda function for cleanup:

import boto3

def cleanup_unattached_volumes(event, context):
    ec2 = boto3.client('ec2')
    volumes = ec2.describe_volumes(
        Filters=[{'Name': 'status', 'Values': ['available']}]
    )

    for vol in volumes['Volumes']:
        # Check if volume has been unattached for 7+ days
        # Add your deletion logic with appropriate safeguards
        pass

Schedule this with EventBridge for weekly execution.

Key Takeaways

  • Start with visibility - You can't optimize what you can't measure. Cost Explorer is free.
  • Reserved Instances/Savings Plans - Easy wins for predictable workloads. Start with 1-year terms.
  • Auto Scaling - Right-size dynamically, but test your policies thoroughly.
  • Automate cleanup - Manual audits don't scale. Build automated resource hygiene.
  • Monitor continuously - Set billing alerts before you need them.

Cost optimization isn't a one-time project. Build it into your operational rhythm with monthly reviews and automated guardrails.

BT

Written by Bar Tsveker

Senior CloudOps Engineer specializing in AWS, Terraform, and infrastructure automation.

Thanks for reading! Have questions or feedback?