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 stack. Simplified to protect client confidentiality.Engineering approach
- Break down spend by service and workload to find the largest drivers before changing anything.
- Add VPC endpoints so that traffic to AWS services no longer crosses NAT gateways.
- Resize ECS tasks and virtual machines using measured CPU and memory data.
- Run fault-tolerant workloads on Spot capacity, with Karpenter provisioning nodes on Kubernetes.
- Cover the steady baseline with reservations or Savings Plans, after right-sizing so commitments are not wasted.
- 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
- Analyze Cost breakdown by service, account and tag, plus usage metrics for compute.
- Quick wins Endpoints, retention periods, snapshot rules and S3 lifecycle policies.
- Right-size ECS and VM sizes reduced in steps, with monitoring after each change.
- Capacity mix Spot and Karpenter introduced for suitable workloads, then commitments for the baseline.
- 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