Controlling ML Spend with Cost Management Tools and Quotas
This lesson explains the visibility and limits that keep ML spend under control, using cost management tools and quotas as the exam guide asks.
Learning outcomes
After completing this lesson, you will be able to:
- Analyze spend with Cost Explorer and allocation tags.
- Set alerts, limits and budget actions.
- Find common ML waste.
Visibility
AWS Cost Explorer analyses spend over time by service, usage type, Region, account and tag, and forecasts future spend. Cost allocation tags, such as project or team, applied to SageMaker AI training jobs, endpoints, notebooks and other resources and activated in the Billing console, let spend be broken down by owner. For Bedrock, application inference profiles carry tags and track model usage and cost per application or tenant. The AWS Cost and Usage Report (data exports) provides line-item detail for analysis in Athena or Quick Sight.
Alerts, limits and recommendations
AWS Budgets sends alerts when actual or forecast spend or usage exceeds a threshold, and budget actions can apply an IAM or service control policy or stop specific EC2 or RDS instances automatically. Cost Anomaly Detection flags unusual spend. Service Quotas limit how many instances of each type can run, acting as a ceiling. Preventive controls include IAM policies or SCPs that deny expensive instance types (condition key sagemaker:InstanceTypes) or unapproved Bedrock models. AWS Trusted Advisor and Compute Optimizer recommend idle-resource clean-up and right-sizing. The following table summarises the tools.
| Need | Tool |
|---|---|
| Analyse spend by service and tag | Cost Explorer with cost allocation tags |
| Bedrock cost per application | Application inference profiles |
| Alert at a spend threshold | AWS Budgets |
| Automatic restriction when over budget | Budget actions (IAM or SCP policies) |
| Detect unusual spend | Cost Anomaly Detection |
| Hard ceiling on instances | Service Quotas |
| Block expensive instance types | IAM / SCP with sagemaker:InstanceTypes |
| Idle and right-sizing recommendations | Trusted Advisor, Compute Optimizer |
Cost tools
Common ML waste
Machine learning environments accumulate waste in recognisable forms: notebook instances and Studio applications left running overnight, endpoints for abandoned experiments, oversized instances, untagged resources that nobody owns, old model artefacts and checkpoints kept in S3 Standard, and full re-embedding of documents that have not changed.
Most of it can be prevented. Lifecycle configurations shut down idle notebooks automatically, tag enforcement ensures every resource has an owner, S3 lifecycle rules move old artefacts to cheaper storage, and regular clean-up reports show remaining waste.
The following diagram shows the preventive and detective controls on a data science sandbox account.

Find the waste
Controlling a data science sandbox
A data science sandbox account overspent by USD 30,000 in one month after someone launched several ml.p4d.24xlarge training jobs and left endpoints running.
- An SCP on the sandbox OU denies SageMaker AI actions with instance types outside an approved list using the sagemaker:InstanceTypes condition.
- AWS Budgets alerts at 50%, 80% and 100% of the monthly budget, with a budget action that applies a deny policy at 100%.
- A Lambda function triggered daily deletes endpoints tagged
env=sandboxthat are older than 7 days. - Tag policies require
ownertags on all resources.
Alerts alone would not have prevented the spend; the SCP and budget action provide hard limits.
How can spending be restricted automatically when a budget is exceeded?
Show answer
With AWS Budgets budget actions.
Exam Tips
Remember for the exam
- Spend by team or project: cost allocation tags in Cost Explorer.
- Bedrock cost per application: application inference profiles.
- Alerts on spend: AWS Budgets; automatic restriction: budget actions.
- Block expensive instance types: SCP or IAM with sagemaker:InstanceTypes.
- Unusual spend patterns: Cost Anomaly Detection.