> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Using AWS Cost Explorer for ML Cost Tracking

> Guide to using AWS Cost Explorer to track, analyze, and forecast ML demo and development costs while optimizing spend with tagging, budgets, and resource cleanup

This guide shows how to use AWS Cost Explorer to track, analyze, and forecast costs generated by machine learning (ML) demos and development environments. Cost Explorer helps you identify which services, resources, or tags are driving spend so you can optimize usage, set budgets, and avoid surprises.

Start from the [AWS Management Console](https://aws.amazon.com/console/) and open [Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/). You can also link Cost Explorer to [AWS Budgets](https://aws.amazon.com/aws-cost-management/aws-budgets/) to create alerts for thresholds and anomalies.

For example, here’s a snapshot of the AWS Management Console showing cost and usage overviews:

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3bGHInX65TLElqZR/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-management-console-screenshot-health-cost-usage.jpg?fit=max&auto=format&n=3bGHInX65TLElqZR&q=85&s=a0323656c87fceb2880a990cfb541400" alt="This image is a screenshot of the AWS Management Console, showing sections for AWS Health, cost and usage, and introductory resources for getting started with AWS." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-management-console-screenshot-health-cost-usage.jpg" />
</Frame>

Key capabilities you’ll use in Cost Explorer:

* View actual (incurred) spend and modelled forecasted spend
* Drill down by service, usage type, account, tag, and region
* Create custom reports and set alerts with AWS Budgets

In many ML accounts the largest costs come from interactive runtimes, training instances, and endpoints. In this account, most spend is coming from [Amazon SageMaker](https://learn.kodekloud.com/user/courses/aws-sagemaker) (Studio and related services).

<Callout icon="warning" color="#FF6B6B">
  Be careful with SageMaker resources: interactive runtimes, endpoints, and training instances can keep incurring charges if left running. Regularly stop or delete unused resources and verify you have no orphaned volumes, endpoints, or long-running training jobs.
</Callout>

Cloud resources created for demos are often forgotten. Regularly audit and terminate unused resources to prevent unexpected bills.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3bGHInX65TLElqZR/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-billing-cost-management-dashboard.jpg?fit=max&auto=format&n=3bGHInX65TLElqZR&q=85&s=c1a5a783248fc5b7e422d0f54f321279" alt="The image shows an AWS Billing and Cost Management dashboard with a cost breakdown graph and recommended actions related to billing alerts and cost anomalies." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-billing-cost-management-dashboard.jpg" />
</Frame>

How to analyze costs with Cost Explorer

1. Open Cost Explorer and select a date range (last month, month-to-date, custom).
2. Choose granularity: monthly, daily, or hourly (hourly helps identify short-lived spikes).
3. Group by dimension(s): Service, Usage Type, Region, Linked Account, or Tags.
4. Apply filters such as specific AWS Accounts, services (e.g., `Amazon SageMaker`), or tags (project/demo name).

In this example the report is grouped by Service so we can see which AWS services are contributing the most to monthly spend. SageMaker appears as the top service, followed by AWS Glue and others.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3bGHInX65TLElqZR/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-cost-explorer-report-june-2026.jpg?fit=max&auto=format&n=3bGHInX65TLElqZR&q=85&s=1eef8b6dcff3cb683ffe1daf1bec153b" alt="The image shows an AWS Cost Explorer report displaying a bar graph of service costs for June 2026, with details of various AWS services and their costs in a popup box. The sidebar includes navigation options and cost management features." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-cost-explorer-report-june-2026.jpg" />
</Frame>

Dig deeper by expanding groups, switching visualization types (bar, area, line), and filtering by usage type or tags. Cost Explorer also produces forecasts based on historical trends and shows prediction intervals (e.g., an 80% prediction interval).

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/3bGHInX65TLElqZR/images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-cost-explorer-screenshot-report.jpg?fit=max&auto=format&n=3bGHInX65TLElqZR&q=85&s=0995584e78e48ae90fd883946d78f5de" alt="The image shows a screenshot of the AWS Cost Explorer interface, displaying a new cost and usage report with various options like report parameters and date range settings." width="1920" height="1080" data-path="images/AWS-Certified-Machine-Learning-Engineer-Associate/ML-Solution-Monitoring-Maintenance-and-Security/Demo-Using-AWS-Cost-Explorer-for-ML-Cost-Tracking/aws-cost-explorer-screenshot-report.jpg" />
</Frame>

Useful Cost Explorer controls (quick reference)

| Control              | Purpose                                          | When to use                                                              |
| -------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ |
| Date range           | Select timeframe to inspect costs                | Monthly review, root-cause for a spike, or historical trend              |
| Granularity          | `Monthly` / `Daily` / `Hourly`                   | Use `Hourly` for short-lived resources, `Daily` for operational patterns |
| Group by / Dimension | Service, Usage Type, Region, Tag, Account        | Identify which service or tag drives cost                                |
| Filters              | Service, Linked Account, Tag, Region             | Narrow the scope to specific projects or teams                           |
| Forecast             | Projected future spend with prediction intervals | Budget planning and capacity forecasting                                 |

Actionable checklist for ML teams

* Tag resources: apply project, environment, or owner tags to SageMaker notebooks, endpoints, training jobs, and datasets.
* Schedule and automate shutdowns: stop interactive runtimes and non-production endpoints when idle.
* Review Cost Explorer weekly: identify anomalies or growth trends early.
* Create budgets and alerts using AWS Budgets to trigger notifications before thresholds are breached.
* Clean up orphaned storage or snapshots that can accumulate costs.

<Callout icon="lightbulb" color="#1CB2FE">
  Tip: Tag [SageMaker](https://learn.kodekloud.com/user/courses/aws-sagemaker) resources (notebooks, endpoints, training jobs) with project or demo identifiers so Cost Explorer can group and attribute costs accurately by project, team, or environment.
</Callout>

References and further reading

* [AWS Cost Explorer overview](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/)
* [AWS Budgets](https://aws.amazon.com/aws-cost-management/aws-budgets/)
* [Amazon SageMaker documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/whatis.html)

Use Cost Explorer proactively to keep ML spending visible, predictable, and searchable by project or owner.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/aws-machine-learning-associates/module/e07ceb86-4976-4c8e-a6f8-3518534ec115/lesson/3cd3b5ee-a67b-45ad-b1f5-89774ebe1a24" />
</CardGroup>
