YOUR DIGITAL HUB
← Back to blog

Reduce your AWS bill: 11 cloud cost optimization levers

12 min read

Cover — Reduce your AWS bill, cloud cost optimization levers

Where to start to reduce an AWS bill

To reduce an AWS bill, work in this order: make costs visible and allocated, delete what serves no purpose, rightsize what remains, and only then commit on the stabilised usage to obtain discounts. Architecture changes come last, because they cost development time.

The order matters. A commitment taken on an oversized estate locks in the excess for one or three years.

This article is the hands-on side of our guide to FinOps, its definition and practice, which covers organisation, roles and metrics. Here, we open the console.

The levers by effort and impact

The real impact depends on what your bill is made of: look at your top five cost items first.

Lever Effort Typical impact Main risk
1. Visibility and tagging Low Indirect, everything else depends on it None
2. Unused resources and rightsizing Low to medium High Undersizing
3. Stopping non-production Low High on the environments concerned Environment unavailable at the wrong time
4. Savings Plans and reservations Low High on steady usage Unused commitment
5. Spot Instances Medium High on interruptible workloads Interruption
6. Graviton Medium Medium Incompatible dependency
7. Storage and lifecycle Low to medium Medium, grows with volume Retrieval fees
8. Data transfer and NAT Medium Variable, sometimes high Network regression
9. Managed databases Medium High, often a top cost item Performance, availability
10. Logs and observability Low Medium Losing useful information
11. Architecture High High over the long term Cost and duration of the work

1. Visibility and tagging

What to check. Can you say what each application, each environment and each team costs? What share of the bill is attributed to nobody?

How to do it. Put environments in separate accounts, grouped in an organization: it is the most reliable allocation boundary. Define a few mandatory tags (application, environment, team) and enforce them in infrastructure as code. Then activate them as cost allocation tags in the billing console: a tag set on a resource does not appear in Cost Explorer until it is activated, and it can take up to 24 hours to show.

The risk. None for production. Three tags applied consistently beat twelve filled in badly.

2. Unused resources and rightsizing

What to check. Detached EBS volumes, old snapshots, unused IP addresses, load balancers with no targets, forgotten test environments. Then instances whose CPU and memory are barely used.

How to do it. Opt in to AWS Compute Optimizer, which analyses utilisation metrics and produces rightsizing recommendations and idle resource findings. It covers EC2 instances, Auto Scaling groups, EBS volumes, Lambda functions, ECS services on Fargate, and RDS and Aurora databases, among others. Recommendations based on the default analysis come at no additional cost. Cost Optimization Hub consolidates these recommendations with those on commitments, across accounts and Regions.

The risk. By default, Compute Optimizer looks at the last 14 days of metrics. A monthly or seasonal peak can escape it. EC2 memory is also not reported to CloudWatch without an agent: install the CloudWatch agent before concluding that an instance is oversized. Downsize in steps and observe.

3. Stopping non-production outside working hours

What to check. Development, staging and demo environments that run at night and at weekends.

How to do it. The Instance Scheduler on AWS solution starts and stops EC2 and RDS instances on a schedule, driven by tags. A week has 168 hours: an environment used for around fifty of them spends most of its time running for nothing. For Aurora Serverless databases, auto-pause scales to zero capacity when there are no connections.

The risk. A stopped instance no longer costs compute, but its storage is still billed. A stopped RDS instance is started again automatically after seven consecutive days, which is why an automated schedule beats a manual stop.

4. Savings Plans and reservations

What to check. The share of your steady usage, hour by hour, still billed at the On-Demand rate.

How to do it. Savings Plans give a lower rate in exchange for an hourly spend commitment over one or three years, paid all upfront, partially upfront or with no upfront payment. AWS offers four types:

Type Applies to Flexibility Maximum discount stated by AWS
Compute Savings Plans EC2, Fargate, Lambda Any instance family, size, Region, operating system Up to 66%
EC2 Instance Savings Plans EC2 One instance family in one Region Up to 72%
Database Savings Plans Aurora, RDS, DynamoDB, ElastiCache and other database services Any engine, family, size, Region, on the latest instance generations Up to 35%
SageMaker AI Savings Plans SageMaker AI instances Any family, size, Region Up to 64%

These ceilings are maximums. The actual discount depends on the service, the term and the payment option. Cost Explorer computes a commitment recommendation from your history. Reserved capacity also exists for some services, such as RDS, ElastiCache or OpenSearch.

The risk. The terms of a commitment cannot be changed after purchase. So commit after rightsizing, on the usage floor and not on the peaks, and top up in increments.

5. Spot Instances

What to check. Workloads that tolerate interruption: batch jobs, CI runners, computation, queue workers, test environments.

How to do it. A Spot Instance uses spare EC2 capacity at a price below the On-Demand rate. Mix Spot and On-Demand in an Auto Scaling group, across several instance types and Availability Zones, to lower the chance of running out of capacity.

The risk. EC2 can reclaim the instance with a two-minute warning. The application therefore has to be stateless or able to resume interrupted work. Spot Instances are not covered by Savings Plans.

6. Graviton

What to check. Workloads running on x86 instances whose software stack runs on the Arm architecture.

How to do it. According to AWS, Graviton-based instances cost up to 20% less than comparable x86-based instances. Managed services such as RDS and Aurora are the easiest starting point: changing the instance class does not require recompiling your code. For your own applications, build multi-architecture container images and test in staging.

The risk. A native dependency or third-party agent may not exist for Arm. PHP, Java, Go, Python and Node.js all run on this architecture, but check your extensions and measure performance before switching.

7. Storage: classes and lifecycle

What to check. S3 buckets where every object sits in the Standard class, old object versions, incomplete multipart uploads, EBS volumes still on gp2, and snapshots with no retention policy.

How to do it. For unpredictable access, S3 Intelligent-Tiering automatically moves objects to a cheaper tier after 30 consecutive days without access, then again after 90 days, with no retrieval fees, in exchange for a per-object monitoring fee. For known access patterns, lifecycle rules transition objects to Standard-IA and then to the Glacier classes, and expire old versions. On EBS, gp3 volumes have a price per GiB 20% lower than gp2, and the migration is done without interrupting the instance.

The risk. Infrequent access classes come with strings attached: per-GB retrieval fees, a minimum storage duration (30 days for Standard-IA, 90 days for Glacier Instant Retrieval and Flexible Retrieval, 180 days for Deep Archive) and a 128 KB minimum billable object size for some of them.

8. Data transfer and NAT gateways

What to check. In Cost Explorer, group by usage type and look for data transfer and NAT gateway lines. This item is often underestimated because it is not attached to any visible resource.

Rules to know. Data transfer in from the internet is free. Data transfer out to the internet is charged. Between Availability Zones in the same Region, traffic is generally charged in both directions. Between Regions, it is charged on the way out of the source Region. A NAT gateway is billed per hour, plus a rate per GB processed.

How to do it.

  • Create gateway endpoints for S3 and DynamoDB: they carry no hourly or data processing charges, and that traffic no longer goes through the NAT.
  • Find what crosses the NAT in volume: container image pulls, logs, backups.
  • Keep components that exchange a lot of data in the same zone, when availability allows.

The risk. A routing change can cut a flow. Test outside production. And do not give up production's multi-AZ layout to save on traffic.

9. Managed databases

What to check. Actual CPU, memory and connection usage, provisioned storage and IOPS, backup retention, the number of read replicas, and Multi-AZ switched on for environments that do not need it.

How to do it. Size the instance class from metrics, move to Graviton, keep Multi-AZ for production, stop non-production databases on a schedule. For a highly variable or intermittent load, evaluate Aurora Serverless. Once the size is stable, cover the usage with a Database Savings Plan or reserved instances.

The risk. An undersized database degrades the whole application. Before downsizing, deal with the cause: a slow query or missing index often costs more than an instance class. A well-placed application cache reduces database load and lets you resize afterwards.

10. Logs and observability

What to check. CloudWatch log groups with no retention period, the log level in production, high-cardinality custom metrics.

How to do it. By default, CloudWatch Logs keeps data indefinitely. Set a retention on every log group, or an account-level retention policy. Lower the log level in production, sample traces, and archive to S3 whatever must be kept for a long time for regulatory reasons.

The risk. Deleting logs you will need during an incident or a security audit.

11. Architecture choices

The most durable gains come from design. A few questions to ask:

  • Does this processing need to run all the time, or can it be triggered by an event or a queue?
  • Is this workload steady (instances or containers with a commitment) or sporadic (serverless)?
  • Are expensive responses cached?
  • Does the level of redundancy match each component's real availability requirement?

These choices are made when designing or evolving the application. Our article on architecting a PHP application on AWS, from MVP to scale gives a staged example. On an existing application, they belong in a legacy application modernization or cloud migration project.

Budgets and alerts

The levers bring the bill down. Alerts stop it from climbing back without anyone noticing.

  • AWS Budgets. Create an overall monthly cost budget and one per environment or team, with alerts on actual and forecasted spend. Coverage and utilization budgets track your Savings Plans and reservations. The data is updated up to three times a day: an alert therefore arrives with a delay and does not block spending.
  • AWS Cost Anomaly Detection. This service uses machine learning to detect deviations from your history, by service, account or tag, and sends individual alerts or daily and weekly summaries.

The monthly review routine

One hour a month, with the head of engineering, a representative from each team and a finance counterpart:

  1. Compare the month's bill with the budget and with the previous month, and explain every notable variance.
  2. Review the top five cost items and their trend.
  3. Check the share of unallocated costs and fix missing tags.
  4. Deal with anomalies detected since the last review.
  5. Check commitment coverage and utilization.
  6. Go through new rightsizing recommendations.
  7. Decide on two or three actions, each with an owner and a due date.
  8. Update the forecast and the unit cost metric.

Frequently asked questions

Why is my AWS bill going up for no obvious reason?

The most common causes are forgotten resources, unlimited log retention, data transfer between zones or through a NAT gateway, accumulating snapshots, or a commitment that has expired. In Cost Explorer, group by service and then by usage type, and compare two months.

What is the fastest way to reduce an AWS bill?

Delete unused resources and stop non-production environments at night and at weekends. Both actions take little effort, do not touch production and show up on the next invoice.

Savings Plans or Reserved Instances: which should I choose?

For EC2, Fargate and Lambda, Savings Plans are generally simpler because they apply automatically and tolerate changes of instance family or Region. For databases, compare the Database Savings Plan with the service's reserved instances according to the flexibility you need.

How do I find the cost of one application or one customer?

Through allocation: separate accounts or tags activated as cost allocation tags, then grouping in Cost Explorer. For a cost per customer on a shared platform, you also need an allocation key derived from your usage metrics.

Conclusion

There is no mystery to reducing an AWS bill: make costs visible, delete, rightsize, commit, then improve the architecture. The first four levers need almost no development work and should be handled first. The hard part is keeping the result, which takes budgets, alerts and a monthly review held consistently over time.

As a custom software development company, we design and run applications on AWS with their running cost in mind. To review your infrastructure, write to us at contact@your-digital-hub.com, see our cloud expertise or describe your context on our contact page.

Let's talk about your project. Send us the essentials.

Tell us the context, whether it is a new build, a takeover or a migration, the technologies in place and your target date.