AWS Cloud Cost Optimization

Reducing AWS operating cost by applying best practices across network, compute, storage and logs.

Project overview

Client
Confidential client (under NDA)
Industry
Software and technology
Role
Principal DevOps Engineer (sole engineer on the cost workstream)
Scope
Cost analysis, network and compute optimization, storage and log policies, commitments

Business challenge

  • AWS spend had grown with the product, and no one could say which resources were necessary.
  • Large parts of the bill came from data transfer, oversized compute, idle storage and logs kept indefinitely.
  • Any change had to protect production reliability.

Existing infrastructure

  • Private workloads reached S3 and other AWS services through NAT gateways.
  • ECS tasks and virtual machines were sized for peak assumptions and never revisited.
  • Everything ran on on-demand capacity with no commitments.
  • Snapshots, S3 objects and log groups had no expiry rules.

Architecture

Cost levers across the AWS stackFour layers show where cost was reduced: network, compute, storage and governance. VPC endpoints reduce NAT data transfer, right-sizing, Spot, Karpenter and reservations reduce compute cost, lifecycle and retention rules limit storage growth, and budgets keep cost visible.NetworkVPC endpoints (S3, ECR)Reduced NAT trafficComputeRight-sized ECS and VMsSpot + KarpenterReservationsStorageS3 lifecycle rulesSnapshot expiryLog retentionGovernanceTaggingBudgets and alertsMonthly review
Cost levers across the AWS stack. Simplified to protect client confidentiality.

Engineering approach

  1. Break down spend by service and workload to find the largest drivers before changing anything.
  2. Add VPC endpoints so that traffic to AWS services no longer crosses NAT gateways.
  3. Resize ECS tasks and virtual machines using measured CPU and memory data.
  4. Run fault-tolerant workloads on Spot capacity, with Karpenter provisioning nodes on Kubernetes.
  5. Cover the steady baseline with reservations or Savings Plans, after right-sizing so commitments are not wasted.
  6. Set log retention, snapshot rules and S3 lifecycle policies, and add budgets and tagging for ongoing visibility.

Technologies used

  • AWS
  • VPC endpoints
  • Amazon ECS
  • Amazon EC2
  • Karpenter
  • Spot Instances
  • S3 lifecycle
  • CloudWatch
  • Terraform

Security considerations

  • VPC endpoint policies restrict which resources can be reached, which also reduces public internet exposure.
  • Retention rules respect compliance requirements, so logs and backups needed for audit are not deleted.
  • Spot interruption handling is tested, so cost savings do not weaken availability.
  • All changes are made through Terraform and reviewed pull requests.

Implementation

  1. Analyze Cost breakdown by service, account and tag, plus usage metrics for compute.
  2. Quick wins Endpoints, retention periods, snapshot rules and S3 lifecycle policies.
  3. Right-size ECS and VM sizes reduced in steps, with monitoring after each change.
  4. Capacity mix Spot and Karpenter introduced for suitable workloads, then commitments for the baseline.
  5. Govern Budgets, alerts and a recurring review so savings persist.

Results and improvements

Technical improvements

  • Traffic to AWS services no longer pays NAT data-processing charges.
  • Compute capacity follows measured demand instead of assumed peaks.
  • Storage growth is bounded by lifecycle, snapshot and log retention rules.
  • Spend is visible by service through tagging and budgets.

Measured results

  • Operating cost reduced by approximately 25–30% by applying AWS best practices across network, compute, storage and logging.
  • Results depend on the starting environment, so each engagement begins with a review of actual usage.

Lessons learned

  • Right-size before buying commitments, or reservations lock in waste.
  • Network data transfer is often overlooked and can be fixed with small changes.
  • Lifecycle and retention rules deliver savings that continue, with no further effort.

Related services

Facing a similar challenge?

Share your current setup and goals, and I will suggest a practical approach.

Discuss Your Project