Cost anomalies and governance
Budget and anomaly signals are different
AWS Budgets compares actual or forecasted cost or usage with a configured threshold. Cost Anomaly Detection compares eligible spending with expected historical patterns and helps identify likely drivers. A planned launch can exceed a budget without being anomalous; a small unusual increase can be detected below budget. Billing data arrives late: anomaly detection may take up to 24 hours after usage and new services require history. Some services and charges are excluded. Neither feature is a universal live kill switch. Budget actions can apply configured IAM/SCP policies or target certain EC2/RDS instances, subject to permissions, supported action and approval settings; they do not stop all existing costs.
Investigate before taking action
Suppose daily expected cost is 2000 cents and reported cost is 3400. The excess is 1400 cents (70%). The lab flags it only if both absolute and relative thresholds are met; this is a teaching rule, not the AWS anomaly algorithm. Group changes by service, account, Region and usage type; compare usage quantity with rate, check deployment and traffic history, identify owner and distinguish expected growth, missing tags, delayed data and unexpected activity. If suspicious credentials are involved follow the incident process. Document evidence and impact; pause an approved noncritical workload only through its runbook. Do not delete backups or production data to reduce a bill.
Build preventive governance
Use account separation, least privilege and SCP restrictions on expensive resource families or Regions where appropriate; SCPs do not apply to the management account. Use service quotas, application rate limits, concurrency limits, bounded retries, scheduled cleanup and ownership tags as complementary controls, not guaranteed spend limits. Define an exception path for production availability. Assign a budget owner and backup responder, test alert delivery, set escalation and track corrective actions. Review commitments, unallocated spend, unit cost and reliability each month. Free-tier credits can expire or be ineligible for a charge; alerts and credits do not eliminate charges.
Practice with an offline FinOps review
In lab-fixtures/finops-review run python test_finops.py. Compare cost allocations, hourly commitments and alerts using the supplied synthetic scenario. Check that shared costs reconcile exactly, missing ownership stays unallocated and a zero denominator returns no ratio. Compare total costs under idle and peak workloads; reject an unapproved or critical resource action. Read the prior billing, Organizations and CloudWatch lessons for prerequisites. This offline model never calls AWS or changes resources; actual prices, SKU eligibility and billing permissions require a separate approved review.
{ "allocation": { "direct": { "orders": 60000, "search": 30000 }, "shared": 10000, "orders_percent": 75, "successes": 45000 }, "commitment": { "on_demand": 10, "discounted": 6, "commitment": 24, "units": [ 1, 4, 8 ] }, "anomaly": { "expected": 2000, "actual": 3400, "absolute": 1000, "percent": 50 }}Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Cost anomalies and governance — knowledge check
Reason about cost allocation, commitment scenarios and governance.
Which signal compares actual or forecast cost against a planned threshold?
Why is anomaly detection not a real-time kill switch?
What should happen before acting on an unusual bill?
What is a complementary preventive control?
What should an unapproved stop request do in the local model?