Sub topic 7
Cost Optimization: delivering value at the lowest price point
This chapter assumes you know core AWS services (EC2, S3, IAM, VPC) and the six pillars introduced earlier. Cost Optimization is the pillar that asks you to deliver business value at the lowest price point. The goal is not the cheapest bill. It is the lowest cost that still meets your reliability, performance and security needs.
The working model
The pillar's design principles give you a working model:
- Implement cloud financial management. Treat cost as a skill your organization builds, with owners, budgets and regular reviews.
- Adopt a consumption model. Pay only for what you use. Stop or scale down resources that sit idle, such as development environments overnight.
- Measure overall efficiency. Compare the business output (orders processed, users served) with the cost to produce it.
- Stop spending on undifferentiated heavy lifting. Use managed services where running the undifferentiated work yourself adds cost but no advantage.
- Analyze and attribute expenditure. Tag resources so you can tell which team or product causes each cost.
Where the savings usually come from
The framework groups best practices into five areas: financial management, awareness of expenditure, cost-effective resources, demand management, and optimizing over time. In practice, most savings come from these levers:
| Lever | What to do | Example |
|---|---|---|
| Right-sizing | Match instance size to measured use | Move a 5% CPU `m5.2xlarge` to `m5.large` |
| Pricing model | Commit for steady load, use Spot for interruptible work | Savings Plans for the API, Spot for batch jobs |
| Storage tiering | Move cold data to cheaper classes | S3 lifecycle rules to Glacier |
| Demand shaping | Scale with load, not for peak | Auto Scaling, queues to smooth bursts |
| Removing waste | Delete unattached volumes and idle load balancers | Cost Explorer and Trusted Advisor findings |
Commitments such as Savings Plans reduce price only if the usage is stable. Buy them after you right-size, not before. Otherwise you commit to capacity you did not need.
Making cost visible
You cannot optimize what you cannot attribute. Activate cost allocation tags, set AWS Budgets alerts, and review AWS Cost Explorer regularly. The command below lists the last month's cost grouped by a team tag.
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=TAG,Key=teamThe tag must be activated as a cost allocation tag in the Billing console first. Otherwise the grouped results come back empty or untagged.
Common errors
- Cutting cost at the expense of other pillars. Removing a second Availability Zone saves money but lowers reliability. Record these as deliberate trade-offs, not accidents.
- Optimizing too early. Spending engineering weeks to save a few dollars costs more than it returns.
- No ownership. Untagged resources have no owner, so no one deletes them.
- Ignoring data transfer. Cross-AZ and internet egress charges often surprise teams that only watched compute.
- One-time clean-up. Costs drift upward again unless review is a recurring habit.
Exercise
A team runs 20 steady-state EC2 instances at 8% average CPU. They plan to buy a three-year Savings Plan sized to their current usage. What should they do first, and why?
Show answer
Right-size the instances first. At 8% CPU they are probably oversized, so a commitment sized to current usage would lock in spend on capacity they do not need. After right-sizing, they should commit only to the stable baseline.
Exercise
Your Cost Explorer report grouped by the team tag shows everything as untagged, although the resources carry the tag. What is the likely cause?
Show answer
The tag has not been activated as a cost allocation tag in the Billing console. Activate it, and later usage will appear grouped by team.