# Cost Optimization and Billing Tools

> Chapter 13 of the Courseiva AWS-SYSOPS-ASSOCIATE curriculum — https://courseiva.com/learn/aws-sysops-associate/cost-optimization-and-billing

**Official objective:** 3.1 — Use AWS Cost Explorer, Budgets, and Trusted Advisor for cost management

## Introduction

The exam objective 3.1 demands that you master cost management and billing tools for the AWS cloud. For anyone studying for the SOA-C02 exam, this chapter tackles the practical problem of keeping cloud spending under control without sacrificing performance. You'll learn how AWS Cost Explorer, Budgets, and Trusted Advisor work individually and together to prevent surprise bills and identify waste.

## The Household Budget and Energy Audit Analogy

A household budget is a plan that tracks every pound coming in and going out. 

Managing AWS costs is like managing your family's finances after moving into a larger house with new appliances and utilities. You start with a monthly budget (AWS Budgets) that sets a spending limit for electricity, water, and gas. But you quickly realise you need to see exactly where the money is going—which rooms use the most power, which appliances are energy hogs, and whether you're paying for services you rarely use. This is AWS Cost Explorer: a detailed spending breakdown by service, region, or even individual resource. 

Now imagine a trusted friend (AWS Trusted Advisor) who walks through your house and says, "Your old fridge uses twice the electricity of a modern one, your attic insulation is thin, and you're paying for a premium TV package you never watch." That friend gives you actionable recommendations: shut down unused devices, switch to more efficient appliances, and cancel unused subscriptions. In AWS, Trusted Advisor checks for idle resources (EC2 instances running 24/7 with no traffic), underutilised databases, and oversized instances you're overpaying for. 

Finally, you set alerts via AWS Budgets: if your electricity bill is projected to exceed your monthly target, you get a text message. This lets you act before you overspend—just like a real household budget keeps your family from financial surprises. 

Together, these three tools form your complete cost optimisation toolkit: Cost Explorer shows the history, Budgets sets the limits, and Trusted Advisor gives the expert advice to reduce waste.

## Core explanation

AWS Cost Explorer is a visual tool that lets you see, understand, and analyse your AWS costs and usage over time. It replaces the need to manually crunch numbers from spreadsheets or guess where your money is going. First, you need to understand the AWS billing system: every time you use an AWS service like Amazon EC2 (virtual servers), you incur a usage cost based on hours of compute, data transfer, or storage consumed. Cost Explorer pulls this data from your account's billing history and displays it in charts and graphs. You can filter by service (e.g., EC2 vs S3 storage), by region (e.g., US East vs Europe), by resource tag (a label you assign, like 'Production' or 'Development'), or by time period (daily, monthly, yearly). For example, you can ask: "How much did I spend on EC2 in the last month?" and get a bar chart showing the exact amount. You can even do what-if forecasting to predict future costs based on past usage—handy for planning budgets. 

AWS Budgets is your alert system. It lets you set spending limits—like a monthly budget of £1,000 for compute costs. Once you create a budget, AWS monitors your actual and forecasted spending against that threshold. If you are projected to hit 80% of the budget, you can receive an email or CloudWatch alarm notification. This gives you time to investigate and cut back before you overshoot. Budgets can be set for total costs, for specific services, or for groups of resources (via tags). They can also alert on a forecast: if your spending is trending to exceed the budget next month, you get warned early. This replaces the old way of discovering you overspent only when the bill arrives. 

AWS Trusted Advisor is a recommendation engine that inspects your AWS account and delivers advice on five categories: cost optimisation, performance, security, fault tolerance, and service limits. For cost optimisation specifically, it checks for things like idle load balancers, underutilised Amazon Elastic Block Store volumes, unassociated Elastic IP addresses (IPs you reserve but don't use), and EC2 instances that are running but have low CPU or network utilisation (meaning you could save money by shutting them down or switching to a smaller instance type). Trusted Advisor highlights these with a traffic-light system: green for no issues, yellow for recommendations, red for action required. Business and Enterprise support plans unlock the full set of checks—some are free for all accounts but limited. This replaces the manual effort of scanning through each resource to find waste. 

Together, these tools form a cost management loop: Cost Explorer shows your spending history and forecasts; Budgets sets thresholds and sends alerts; Trusted Advisor gives specific, actionable recommendations to reduce waste. A beginner's key insight is that AWS charges you for resources regardless of whether they are idle. So the biggest lever for cost optimisation is identifying and eliminating idle or oversized resources. 

Other supporting concepts include Consolidated Billing for AWS Organizations (which combines all accounts under one bill for volume discounts), Reserved Instances (you commit to 1 or 3 years of service usage for a discount), and Savings Plans (a flexible discount model covering compute usage). These are tested alongside the main three tools. Finally, remember that Cost Explorer data has a delay of up to 24 hours, Budgets are set per account or organisation, and Trusted Advisor checks refresh approximately every 24 hours.

## Real-world context

An IT professional—say a junior cloud operations engineer at a mid-sized e-commerce company—uses these tools almost daily. The company runs a multi-service web application on AWS using EC2 instances (virtual machines) for the front end, RDS (Relational Database Service) for the database, and S3 (Simple Storage Service) for storing product images and user uploads. The monthly AWS bill has been creeping up every quarter, and management wants to cut costs by 15% without breaking the application. 

First, the engineer opens AWS Cost Explorer. They filter by the last 90 days and group costs by service. They see that EC2 accounts for 60% of total spend, and within EC2, a specific set of instances tagged 'development' shows high costs but low activity. They also notice a spike in data transfer costs from S3 to the internet. Next, they apply a filter for resource tags: the development environment has a tag 'Environment: Dev', while production has 'Environment: Prod'. They compare the two and see that development costs are nearly half of all compute, but the development team only works during business hours. This is a clear target for savings. 

Then the engineer configures AWS Budgets. They create a monthly cost budget of £10,000 for the entire account, with an alert at 80% and 90% of the budget. They also create a specific budget for the development EC2 instances: a limit of £2,000 per month, with a forecasted alert at 100%. They link the alerts to an email distribution list that includes the engineering lead and the finance team. This ensures that if spending spikes, someone gets notified before the month ends. 

Finally, they run AWS Trusted Advisor, specifically the cost optimisation category. The report shows several red items: 
- Three EC2 instances that have had a CPU utilisation below 10% for the past two weeks (these are clearly oversized or idle). 
- Two unassociated Elastic IP addresses costing £0.005 per hour each (small, but adds up). 
- An Amazon EBS volume (block storage attached to EC2) that is sized at 500 GB but only 20 GB is used. 
- One RDS database instance that was provisioned for a proof-of-concept and is still running with no connections for months. 

The engineer uses Trusted Advisor's recommendations to immediately stop the idle development EC2 instances during nights and weekends (using an AWS Instance Scheduler solution), delete the unassociated Elastic IPs, resize the EBS volume to 50 GB (after taking a snapshot), and terminate the abandoned RDS instance. They also review the recommendations for Reserved Instances: Trusted Advisor suggests that for the always-on production EC2 instances, purchasing a 1-year Reserved Instance could save 30% compared to on-demand pricing. They present this to the manager and get approval to purchase. 

Within a month, the company's AWS bill drops by 18%—exceeding the 15% target. The engineer continues to monitor Cost Explorer weekly and adjusts Budgets as the application grows. They also set up a weekly Trusted Advisor report that emails the cost optimisation check results to the team. This real-world workflow proves that cost optimisation is an ongoing process, not a one-time fix.

## Exam focus

The SOA-C02 exam tests your knowledge of cost optimisation and billing tools in several specific ways. First, you must understand the purpose of each tool (Cost Explorer, Budgets, Trusted Advisor) and when to use which. The exam presents scenario-based questions where you need to choose the correct tool for a given requirement. A common trap is confusing Cost Explorer (which analyses past and forecasted usage) with Budgets (which alerts on thresholds). For example, a question says: 'A company wants to receive a notification when their monthly EC2 spending exceeds £5,000.' The incorrect answer might be Cost Explorer—the correct answer is Budgets. 

The exam also tests detailed features: 
- In Cost Explorer, you can download the data as a CSV file. You can filter by dimensions like service, region, instance type, or tag. You can also use 'Hourly and Resource Level' granularity for some services (but not all). You can create custom cost and usage reports and save them. 
- In Budgets, you can create three types: Cost Budget, Usage Budget (e.g., 10,000 hours of EC2 usage), and Reservation Budget (to track utilisation of Reserved Instances). Budgets can be set at the account level or as part of AWS Organizations. You can trigger actions when a budget threshold is reached, like stopping EC2 instances automatically (using AWS Lambda). 
- In Trusted Advisor, the full cost optimisation checks are available only with Business or Enterprise support plans. The free tier includes limited checks (only 7 core checks across all categories). The exam often asks which Trusted Advisor checks are available to all AWS accounts—common ones are: 'IAM Use', 'MFA on Root Account', 'Amazon EBS Public Snapshots', 'S3 Bucket Permissions', and 'Service Limits'. Note that cost optimisation checks (like idle instances, underutilised EBS volumes, unassociated Elastic IPs) are NOT included in the free tier. 

Another popular exam question involves understanding 'Reserved Instance' and 'Savings Plan' recommendations. Cost Explorer shows savings recommendations based on your historic usage. You must explain that a Reserved Instance requires a 1- or 3-year commitment but offers lower hourly rates. A Savings Plan is more flexible (applies to any compute usage within a commitment). Trusted Advisor also recommends these when it finds consistent usage patterns. 

Traps the exam sets: 
- They might ask how to reduce costs without manual intervention. The answer often involves using 'Auto Scaling' (to match capacity to demand) or 'AWS Instance Scheduler' (to stop/start instances on a schedule). These are indirectly related to cost optimisation but not part of the three tools. 
- They might test whether Budgets can be used to forecast costs—no, budgets alert on actual or forecasted spending but do not forecast themselves (Cost Explorer does forecasting). 
- They might ask about 'Trusted Advisor vs. AWS Compute Optimizer'—Compute Optimizer gives more granular recommendations for instance right-sizing, but both are used for cost optimisation. 
- They might test that Cost Explorer data has a 24-hour lag—so you cannot get real-time cost data from it. For real-time, use AWS Cost and Usage Reports combined with Amazon Athena or QuickSight. 

To summarise, the exam expects you to differentiate between these three tools, know their limitations, and apply them in realistic scenarios. Practise by reading AWS documentation on each tool and taking sample questions that ask 'Which tool should you use to...?'.

## Step by step

1. **Enable AWS Cost Explorer** — By default, Cost Explorer is enabled for most accounts, but you should verify this in the AWS Billing and Cost Management console. Once enabled, it starts collecting your usage data. This is essential because without it, you cannot view or analyse your spending trends.
2. **Create your first Cost Budget in AWS Budgets** — Go to the Budgets dashboard and create a Cost Budget with a monthly amount (e.g., £10,000). Set the first alert at 80% and the second at 100%. This ensures you get notified before you overshoot, giving you time to investigate and act.
3. **Run a Trusted Advisor cost optimisation check** — Open Trusted Advisor and select the Cost Optimisation category. Review the list of findings—idle EC2 instances, underutilised EBS volumes, unassociated Elastic IPs, etc. For each red item, evaluate whether you can stop, delete, or resize the resource to save money.
4. **Analyse usage patterns in Cost Explorer** — Use Cost Explorer to filter your data by service (e.g., EC2), by tag (e.g., environment), or by region. Look for spikes or consistent over-provisioning. This analysis helps you decide which resources to right-size or where to apply Reserved Instances.
5. **Implement a scheduled stop/start for development instances** — Based on your Cost Explorer findings, create an Instance Scheduler (using AWS Lambda) that stops development EC2 instances at 7 PM and starts them at 7 AM on weekdays, and keeps them off at weekends. This can reduce your development compute costs by up to 60%.
6. **Set up a weekly Trusted Advisor report email** — Configure Trusted Advisor to send a weekly email report of all cost optimisation findings. This automates the monitoring loop and ensures you catch new waste promptly without manually logging in each day.
7. **Review and adjust budgets monthly** — At the start of each month, compare your actual spend from Cost Explorer against your budget. Adjust the budget amounts for the next month based on new projects, growth, or cost-saving measures you implemented. This keeps your spending targets realistic.

## Comparisons

### AWS Cost Explorer vs AWS Budgets

**AWS Cost Explorer:**
- Focuses on historical and forecasted cost analysis
- Provides visual charts and downloadable reports
- No alerting capability on its own

**AWS Budgets:**
- Focuses on notifying you when spending exceeds or is forecasted to exceed a threshold
- Provides alerts via email or CloudWatch alarms
- Does not show historical spending trends

### Cost Optimisation in Trusted Advisor vs Cost Explorer Savings Recommendations

**Cost Optimisation in Trusted Advisor:**
- Identifies idle and underutilised resources
- Based on best-practice rules (e.g., CPU below 10%)
- Full checks require Business or Enterprise support

**Cost Explorer Savings Recommendations:**
- Recommends Reserved Instances and Savings Plans
- Based on your specific usage patterns and history
- Available with any support plan (but data latency of 24h)

### Reserved Instance vs Savings Plan

**Reserved Instance:**
- Requires commitment to a specific instance family in a specific region
- Provides the highest discount (up to 72%) for consistent usage
- Less flexible if your usage changes

**Savings Plan:**
- Applies to any compute usage (EC2, Fargate, Lambda) up to a hourly commitment
- Slightly lower discount than RIs (up to 66%) but more flexible
- Ideal for workloads that vary in instance types

### AWS Free Tier Trusted Advisor Checks vs Business/Enterprise Trusted Advisor Checks

**AWS Free Tier Trusted Advisor Checks:**
- Includes only 7 core checks (IAM, MFA, S3, etc.)
- No cost optimisation or performance checks
- Limited to one refresh per week

**Business/Enterprise Trusted Advisor Checks:**
- Includes full set of checks in all five categories
- Includes all cost optimisation checks (idle instances, etc.)
- More frequent refresh and programmatic access via API

## Common misconceptions

- **Misconception:** AWS Trusted Advisor is a free tool that gives unlimited cost optimisation recommendations for all AWS accounts. **Reality:** Trusted Advisor's full cost optimisation checks are only available to accounts with Business or Enterprise support plans. Free accounts only get limited checks (like IAM use, S3 bucket permissions), not cost recommendations like idle instances. (Beginners often assume all AWS tools are free and full-featured because AWS markets the console with a friendly interface. They don't realise that advanced insights require paying for support plans.)
- **Misconception:** Cost Explorer shows real-time cost data, so you can use it to see exactly how much you're spending right now. **Reality:** Cost Explorer data has a latency of about 24 hours. It shows historical and forecasted costs, but not real-time. For near-real-time, you need AWS Cost and Usage Reports with Athena or CloudWatch billing metrics. (People are accustomed to instant feedback from banking apps or credit card statements, so they assume AWS billing tools work the same way. The delay is due to how AWS aggregates billing data across regions and services.)
- **Misconception:** Setting a budget in AWS Budgets automatically prevents you from overspending by blocking new resource creation. **Reality:** Budgets only send alerts (email or CloudWatch alarm) when you exceed thresholds. They don't automatically stop or block spending unless you configure a custom action using Lambda or another service. By default, they are passive notifications. (The word 'budget' in personal finance often implies a hard limit—your card gets declined if you overspend. AWS Budgets is purely a monitoring and alerting tool, not a control mechanism.)
- **Misconception:** Trusted Advisor and Cost Explorer are the same tool—they both give spending insights. **Reality:** Cost Explorer focuses on analysing historical usage and forecasting future costs. Trusted Advisor provides recommendations across security, cost, performance, fault tolerance, and service limits, but its cost recommendations are based on best practices (e.g., idle resources), not on your spending history alone. (Both tools live in the same AWS console section and deal with costs, leading beginners to think they are interchangeable. Their purposes and outputs are fundamentally different.)
- **Misconception:** You only need to check cost optimisation tools once when you set up your AWS account, and then you're done. **Reality:** Cost optimisation is an ongoing process. Your usage patterns change over time (new projects, growth, seasonality), so you should review Cost Explorer monthly, adjust Budgets quarterly, and run Trusted Advisor checks weekly or after major changes. (People treat cloud costs like a one-time purchase (buy a server and it runs for years). AWS is usage-based and dynamic, so waste accumulates if you don't monitor continuously.)

## Key takeaways

- AWS Cost Explorer shows you historical cost and usage data with up to 24 hours latency, and it can forecast future spending based on past patterns.
- AWS Budgets alerts you via email or CloudWatch alarm when your actual or forecasted spending exceeds a threshold you set, but it does not prevent spending automatically.
- AWS Trusted Advisor provides cost optimisation recommendations (like idle instances and underutilised volumes) but full cost checks require a Business or Enterprise support plan.
- The biggest source of cloud waste is idle resources: EC2 instances running with low CPU, unassociated Elastic IPs, and unattached EBS volumes.
- Reserved Instances and Savings Plans offer significant discounts in exchange for a 1- or 3-year commitment, and Cost Explorer can recommend the best options based on your usage.
- You can use AWS Organisations with Consolidated Billing to get volume discounts across multiple accounts, and then use Budgets and Cost Explorer at the organisation level.

## FAQ

**What is the difference between AWS Cost Explorer and AWS Budgets?**

Cost Explorer shows you your historical spending and can forecast future costs, while Budgets alerts you when spending reaches a threshold you define. Think of Cost Explorer as the dashboard, and Budgets as the alarm system.

**Is AWS Trusted Advisor free for all accounts?**

Basic Trusted Advisor checks (like IAM usage and S3 bucket permissions) are free for all accounts, but full cost optimisation checks (like idle instances and underutilised volumes) require Business or Enterprise support plans.

**How often does AWS Cost Explorer update its data?**

Cost Explorer data is refreshed once every 24 hours, so it does not show real-time costs. For near-real-time data, you can use AWS Cost and Usage Reports with Athena or Amazon QuickSight.

**Can AWS Budgets automatically stop EC2 instances to prevent overspending?**

Not by itself. Budgets only sends notifications. However, you can set up an AWS Lambda function triggered by a CloudWatch alarm that the budget creates, and that Lambda can stop or terminate instances. This requires custom coding.

**What are the most common cost optimisation recommendations from Trusted Advisor?**

The most common recommendations include: idle EC2 instances, underutilised EBS volumes, unassociated Elastic IP addresses, and opportunities for Reserved Instance or Savings Plan purchases. These are the low-hanging fruit for saving money.

**How do I see costs broken down by department or team?**

You need to use resource tags. Tag your resources with keys like 'Department' or 'Project', then enable cost allocation tags in the Billing console. Cost Explorer can then filter by those tags to show spending per team.

---

Interactive version with quiz and diagrams: https://courseiva.com/learn/aws-sysops-associate/cost-optimization-and-billing
