Cutting the AWS bill: finding waste and choosing between Reserved Instances and Savings Plans
Cost Explorer by service and tag, a small Go tool that finds idle EBS volumes, Elastic IPs and old snapshots, and Reserved Instances against Savings Plans worked through with my own t3.small reservation and Mumbai prices.
When I moved this blog to Docker Compose, the plan said t3.medium. Then I remembered I already had a regional t3.small Reserved Instance running until March 2027, and the new box became a t3.small instead. That was the biggest saving available to me, bigger than everything else in this post put together.
In this blog we will do the same thing on any account. First, see where the money goes with Cost Explorer, by service and by tag. Then, find the waste: idle EBS volumes, Elastic IPs and snapshots nobody remembers, with a small read-only Go tool. Finally, choose between Reserved Instances and Savings Plans, with my t3.small as the worked example. This is a beginner post. You need the AWS CLI with read access to billing and EC2.
Prices are for ap-south-1 (Mumbai), Linux, from the AWS Price List API on 19 November 2026 (the EC2 and Savings Plans offer files are dated 18 November). They're list prices for today, not what I paid when I bought my reservation. Go 1.27.3 and aws-sdk-go-v2 with the ec2 module 1.349.0. I built and tested the Go code with fake data. None of the commands below were run against an account for this post.
💻 The full code for this tutorial is on GitHub: FenixAra/tutorials/AWS/Billing/cutting-the-aws-bill-finding-waste-and-choosing-between-reserved-instances-and-savings-plans. Clone it and run each step yourself.
Where the money goes
Cost Explorer has a console, but I prefer the CLI because I can keep the commands. Last month by service:
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICE \
--query 'ResultsByTime[0].Groups[?to_number(Metrics.UnblendedCost.Amount) > `0.01`].[Keys[0], Metrics.UnblendedCost.Amount]' \
--output table
The --query drops the long tail of services that cost a fraction of a cent. The End date is exclusive, so 2026-11-01 means the whole of October. I tested that query expression against a sample response with the same JMESPath library the CLI uses, because getting the backticks wrong in a shell is quite easy.
Then the same thing with Key=USAGE_TYPE instead of SERVICE. This is where surprises show up. Usage types like APS3-PublicIPv4:InUseAddress or APS3-NatGateway-Hours tell you exactly what you're paying for, where the service view just says "EC2 - Other" or "VPC".
One thing to know: every Cost Explorer API call costs $0.01. Running these by hand is nothing. A script that loops over days and services in a cron job can add up, so cache the results.
By tag
If you tag resources with something like Project=shorty, you can split costs by project. The tag has to be activated as a cost allocation tag first, and it only applies to costs from the time you activate it. Not before.
aws ce update-cost-allocation-tags-status \
--cost-allocation-tags-status TagKey=Project,Status=Active
aws ce get-cost-and-usage \
--time-period Start=2026-11-01,End=2026-11-19 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=TAG,Key=Project \
--output table
Untagged costs show up as Project$ with an empty value. If that's the biggest line, start tagging before you start optimising. In Terraform, default_tags in the provider block does it for every resource at once.
Finding the waste
Most waste in small accounts is the same three things. A volume left behind when an instance was terminated. An Elastic IP that isn't attached to anything. Snapshots taken "just in case" years ago. See, none of them show up in the instance list, so nobody looks.
Here are the Mumbai prices that matter for them:
| Resource | Price | Per month |
|---|---|---|
| gp3 volume | $0.0912 per GB-month | 40 GB = $3.65 |
| gp2 volume | $0.114 per GB-month | 30 GB = $3.42 |
| EBS snapshot | $0.05 per GB-month | incremental, so less than the volume size |
| Public IPv4 (in use or idle) | $0.005 per hour | $3.65 per address |
Since February 2024 every public IPv4 address costs money, attached or not. An idle Elastic IP costs the same $3.65 as one that's in use, it just does nothing for it.
I wrote a small Go tool that lists all three kinds of waste with a rough monthly cost. It only calls Describe* APIs, so it can't change anything. The core is three small functions.
func volumeFinding(v types.Volume) Finding {
size := float64(aws.ToInt32(v.Size))
return Finding{
Kind: "ebs-volume",
ID: aws.ToString(v.VolumeId),
Detail: fmt.Sprintf("%s %d GB, created %s, not attached", v.VolumeType, aws.ToInt32(v.Size), aws.ToTime(v.CreateTime).Format("2006-01-02")),
Monthly: size * PricePerGBMonth[v.VolumeType],
}
}
func addressFinding(a types.Address) (Finding, bool) {
if a.AssociationId != nil {
return Finding{}, false // in use; still billed, but not waste
}
return Finding{
Kind: "elastic-ip",
ID: aws.ToString(a.AllocationId),
Detail: aws.ToString(a.PublicIp) + " not associated",
Monthly: PublicIPv4PerHour * hoursPerMonth,
}, true
}
func snapshotFinding(s types.Snapshot, cutoff time.Time) (Finding, bool) {
if !aws.ToTime(s.StartTime).Before(cutoff) {
return Finding{}, false
}
for _, t := range s.Tags {
// Data Lifecycle Manager tags what it creates and deletes it on schedule.
if aws.ToString(t.Key) == "aws:dlm:lifecycle-policy-id" {
return Finding{}, false
}
}
size := float64(aws.ToInt32(s.VolumeSize))
return Finding{
Kind: "snapshot",
ID: aws.ToString(s.SnapshotId),
Detail: fmt.Sprintf("%d GB volume, taken %s, %q", aws.ToInt32(s.VolumeSize), aws.ToTime(s.StartTime).Format("2006-01-02"), aws.ToString(s.Description)),
// Snapshots are incremental; the volume size is an upper bound.
Monthly: size * SnapshotPerGBMonth,
}, true
}
Find pages through DescribeVolumes with a status=available filter (available means not attached), DescribeAddresses, and DescribeSnapshots with OwnerIds: self. The self part matters. Without it you get every public snapshot in the region and the tool runs for a very long time.
The snapshot rule skips anything with the aws:dlm:lifecycle-policy-id tag. My daily snapshots come from Data Lifecycle Manager, which keeps seven and deletes the rest by itself (Daily EBS snapshots with Data Lifecycle Manager in Terraform). Those aren't waste. Manual ones are the ones to look at.
The test uses a fake EC2 client with one gp2 volume, an associated and an unassociated Elastic IP, and three snapshots: a manual old one, a DLM one, and a new one. Only the volume, the idle IP and the manual snapshot should come back.
go test -count=1 ./...
AWS_REGION=ap-south-1 go run ./cmd/waste -snapshot-age 720h
The snapshot cost is an upper bound. A snapshot only stores the blocks that changed since the one before it, and the API doesn't tell you the real size. Treat the number as "at most".
What I found on my own setup
On my own account, the manual snapshots I know about are there on purpose. When I terminated the old Ghost host on 10 November I kept its disk as two snapshots, one from before the migration and one final copy. That was a 30 GB gp2 volume, so at most $1.50 a month each and less in practice since the second shares blocks with the first. I'm keeping them as of now. I just want them on a list with a date, so they don't turn into the "just in case" snapshots from 2019 that every account seems to have.
The Elastic IP is in use and has to stay, the DNS at GoDaddy points at it. That's $3.65 a month I can't do much about, short of putting a load balancer in front, which costs much more.
One more that the tool doesn't find: volumes attached to stopped instances. They're "in-use", but a stopped instance you forgot about still pays for its disks every month. aws ec2 describe-instances --filters Name=instance-state-name,Values=stopped is worth a look now and then.
Reserved Instances or Savings Plans
Both give you a discount for promising to pay for compute for one or three years. The difference is what you promise.
A Reserved Instance is a promise about an instance type in a region, like "one t3.small in ap-south-1, Linux". A regional Linux RI also has size flexibility within the family: a t3.small RI covers one t3.small, or half of a t3.medium, or two t3.micros. A Standard RI can't change family. A Convertible RI can be exchanged for another, at a smaller discount.
A Savings Plan is a promise of dollars per hour, like "$0.0141 an hour of compute". An EC2 Instance Savings Plan is locked to a family in a region (t3 in Mumbai) but any size and OS. A Compute Savings Plan applies to any family, any region, and Fargate and Lambda too. Flexibility costs discount, as you'll see.
The worked example: one t3.small
Here are today's Mumbai rates for a t3.small, put into a year. The program that prints this is in the full code. It just multiplies the hourly rate by 8,760 hours and adds the upfront part.
option per year per month saving
On-demand $196.22 $16.35 0%
Standard RI, 1yr, no upfront $123.52 $10.29 37%
Standard RI, 1yr, partial upfront $117.69 $9.81 40%
Standard RI, 1yr, all upfront $115.00 $9.58 41%
Convertible RI, 1yr, no upfront $141.91 $11.83 28%
EC2 Instance SP, 1yr, no upfront $123.52 $10.29 37%
EC2 Instance SP, 1yr, all upfront $115.63 $9.64 41%
Compute SP, 1yr, no upfront $141.91 $11.83 28%
Compute SP, 1yr, all upfront $132.28 $11.02 33%
t4g.small on-demand (no commitment) $98.11 $8.18 50%
t4g.small standard RI, 1yr, all upfront $58.00 $4.83 70%
A few things jump out. A Standard RI and an EC2 Instance Savings Plan give almost the same price for the same payment option. A Compute Savings Plan saves less, 28 to 33 percent, because it would cover any instance anywhere. And paying all upfront only saves a few dollars over no upfront on a single small box. Not worth tying up the money for, in my opinion, unless you have nothing better to do with it.
Then the last two lines. The bottom two are actually not a commitment trick, they are different instance. A t4g.small (Graviton, ARM) on demand, with no commitment at all, is cheaper than a t3.small with the best one-year deal. Same 2 vCPUs, same 2 GB.
Why I have an RI and what I'll do next
My blog is one instance that runs all the time and that I don't plan to move between families or regions. That's exactly the case RIs were made for, and a regional RI is what I have. When the old Ghost-CLI host was terminated and the new Compose host started, the reservation moved over without me doing anything, because it isn't tied to an instance ID or an availability zone (Running Ghost 6 and MySQL 8 on a 2 GB t3.small has the memory side of that story). Had I stayed on the t3.medium, size flexibility would have covered half of it and the other half would be on demand.
This is how I check what reservations exist and when they end:
aws ec2 describe-reserved-instances \
--filters Name=state,Values=active \
--query 'ReservedInstances[].{type: InstanceType, scope: Scope, count: InstanceCount, class: OfferingClass, payment: OfferingType, end: End}' \
--output table
Put the end date in a calendar. When an RI expires nothing breaks. The instance just quietly goes back to on-demand price, and you only notice on the next bill.
When mine ends in March, I won't buy the same thing again by default. The table says moving to t4g.small saves more than any commitment on t3. The official Ghost, MySQL 8.4 and Caddy images all come in arm64, so the work is basically testing a restore from the nightly backup on a t4g and changing one variable in Terraform. Anything I build myself would need images for both architectures, which Building multi-architecture images for amd64 and arm64 with buildx covers. Then, if it runs happily for a month or two, a reservation on the t4g.
What I'd tell a team
For one or two steady instances that won't change, a Standard RI or an EC2 Instance Savings Plan, one year, no upfront. They are almost the same price and the Savings Plan is simpler to manage. For anything with Fargate, Lambda or instance types that change every few months, a Compute Savings Plan sized to your lowest steady hourly spend, never the average. Unused commitment is money gone.
AWS will suggest a size for you based on the last 30 days:
aws ce get-savings-plans-purchase-recommendation \
--savings-plans-type COMPUTE_SP \
--term-in-years ONE_YEAR \
--payment-option NO_UPFRONT \
--lookback-period-in-days THIRTY_DAYS
I read that recommendation as an upper limit and buy a bit less. Last month's usage are rarely next year's.
The order I'd do it in
Delete the waste first, because that's free money and needs no commitment. Then right-size: smaller instances, gp2 to gp3 (20 percent cheaper per GB in Mumbai and you can change it live), Graviton where your images allow. Only then commit, because a reservation on an oversized instance just locks in the waste for a year. And keep a budget alert running the whole time, as in Setting up a new AWS account safely.
If NAT gateways or CloudWatch Logs are big lines in your usage type report, Building a VPC by hand and CloudWatch for developers cover where those costs come from.