Blog, 9 May 2023, updated 4 November 2026, AWS

A Practical Guide to Optimizing Your AWS Infrastructure for Cost

Start with visibility

You cannot optimize what you cannot see. Before changing anything, make sure you can answer two questions: what are we spending, and who owns it?

Piggy bank and an energy-saving bulb beside a laptop

Tag resources and activate cost allocation tags

Agree on a small set of tag keys, such as Environment, Application, Owner and CostCenter, and apply them consistently, ideally through infrastructure as code. Tags do not appear in billing data until you activate them as cost allocation tags in the Billing and Cost Management console, and newly activated tags can take up to 24 hours to show up. Only the management account of an organization, or a standalone account, can activate them.

In a multi-account setup, accounts themselves are a strong cost boundary. Separating production, staging and each major application into its own account under AWS Organizations makes costs easy to attribute even where tagging is imperfect.

Use Cost Explorer, Budgets and Cost Anomaly Detection

  • AWS Cost Explorer shows spend by service, account, Region, usage type and tag. Group by usage type to find line items such as data transfer or NAT gateway processing that hide inside a service total.
  • AWS Budgets sends alerts when actual or forecast spend crosses a threshold. Set at least one budget per account and per major application.
  • AWS Cost Anomaly Detection monitors spend and alerts you to unusual increases, so a misconfigured job is caught in days rather than at the end of the month.

Rightsize before you commit

Rightsizing means matching instance types and sizes to actual demand. AWS Compute Optimizer analyzes CloudWatch utilization metrics and recommends changes for Amazon EC2 instances, Auto Scaling groups, Amazon EBS volumes, AWS Lambda functions, Amazon ECS services on AWS Fargate, Amazon RDS and Aurora databases, and other resource types. It also flags idle resources.

By default Compute Optimizer looks at the last 14 days of metrics. The paid enhanced infrastructure metrics feature extends that to 93 days, which helps for workloads with monthly cycles. CPU is collected by default, but memory is not: install the CloudWatch agent so memory-bound instances are not downsized by mistake.

Rightsize first and commit second. A Savings Plan bought for oversized instances locks in waste.

Choose the right pricing model

On-Demand is the most flexible pricing and the most expensive per hour. For usage you can predict, commit; for work that can be interrupted, use Spot.

Savings Plans and Reserved Instances

Savings Plans trade a one- or three-year commitment to a dollar amount per hour for lower rates. There are four types:

  • Compute Savings Plans apply to EC2 usage regardless of instance family, size, Region, operating system or tenancy, and also to AWS Fargate and AWS Lambda. Up to 66% off On-Demand.
  • EC2 Instance Savings Plans apply to one instance family in one Region, at any size, OS or tenancy. Up to 72% off On-Demand.
  • Database Savings Plans apply to eligible database services, including Amazon Aurora, Amazon RDS, Amazon DynamoDB and Amazon ElastiCache. Up to 35% off.
  • SageMaker AI Savings Plans apply to Amazon SageMaker AI instance usage. Up to 64% off.

Reserved Instances are the older commitment model. They still matter for services that Savings Plans do not cover and for capacity reservations in a specific Availability Zone. For most EC2 compute, Compute Savings Plans give similar discounts with far more flexibility. Cost Explorer generates Savings Plans purchase recommendations from your usage history; start with a commitment that covers your steady baseline, not your peak.

Spot Instances

Spot Instances use spare EC2 capacity at up to 90% off On-Demand prices. There is no bidding: you pay the current Spot price, which changes gradually with long-term supply and demand. EC2 can reclaim a Spot Instance with a two-minute interruption notice, so Spot suits stateless, fault-tolerant work: batch jobs, CI runners, data processing, and container or Kubernetes worker nodes. Diversify across several instance types and Availability Zones, and use an allocation strategy such as price-capacity-optimized in EC2 Auto Scaling or EC2 Fleet to reduce interruptions.

Move to AWS Graviton where you can

AWS Graviton processors are Arm-based processors designed by AWS, available in EC2 instance families with a “g” in the name (for example M7g, C7g and R8g) and in managed services such as Amazon RDS, Amazon Aurora, Amazon ElastiCache, AWS Lambda and AWS Fargate. For managed services the switch is often just an instance class change. For your own code, interpreted languages and most container images built for multiple architectures move easily; native binaries need an Arm build. Test performance on your own workload and compare price per unit of work, not price per hour.

Fix storage

EBS: move gp2 to gp3

gp3 volumes have a price per GiB 20% lower than gp2 and include a baseline of 3,000 IOPS and 125 MiB/s regardless of size. gp2 performance scales with size, so teams often overprovision gp2 capacity just to get IOPS. You can change the volume type in place with Elastic Volumes, without detaching the volume or stopping the instance. Check the new volume’s IOPS and throughput settings against what the old gp2 volume delivered.

S3: use the right storage class

For data with unknown or changing access patterns, S3 Intelligent-Tiering moves objects between access tiers automatically, with no retrieval fees and a small monthly monitoring fee per object. Objects smaller than 128 KB are not tiered and are always billed at the Frequent Access rate. For data you know is rarely read, use lifecycle rules to move it to S3 Standard-Infrequent Access or an S3 Glacier storage class, and to expire old object versions and incomplete multipart uploads.

Snapshots and logs

EBS snapshots and CloudWatch Logs grow quietly. Use Amazon Data Lifecycle Manager or AWS Backup to enforce snapshot retention, and set a retention period on every CloudWatch Logs log group, because new log groups keep data indefinitely by default.

Remove idle resources

Idle resources cost money every hour. Look regularly for:

  • Unattached EBS volumes and snapshots of deleted volumes.
  • Stopped instances that are never restarted (their EBS volumes are still billed).
  • Idle load balancers, NAT gateways and unused public IPv4 addresses.
  • Development and test environments running outside working hours. Schedule them to stop overnight and at weekends.

AWS Trusted Advisor and Compute Optimizer both report idle and underused resources, and AWS Cost Optimization Hub collects cost recommendations across accounts and Regions in one place.

Make it a habit

Cost optimization is not a one-time project. Review the bill monthly with the teams that own the spend, track Savings Plans coverage and utilization in Cost Explorer, and treat cost alerts like any other operational alert.

9Acts is an AWS Advanced Tier Services Partner and AWS MSP Partner with 100+ AWS certifications across the team. If you want help finding and acting on savings in your accounts, see our cloud optimization service.

All articles

Book a review

Vikram or Narendar, our partners, reply within one business day.

  1. A partner repliesWithin one business day, with a few questions about your setup.
  2. A 30-minute callWith a senior engineer. We scope what you need and check AWS funding eligibility.
  3. A clear proposalWhat we will do, in what order, and what it costs, before any work starts.

We use these details only to reply to you and prepare for a call. See our privacy policy for what we keep and how to have it deleted.