---
title: "Give every account a budget with alerts · Agent Wranglers"
url: https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/budgets-for-every-account
updated: 2026-10-20
licence: "All rights reserved"
---

# Give every account a budget with alerts

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Required
- Chapter: [Cost and ownership](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership)
- Rule: Create a monthly budget in code for every account. Alert the owning team when the forecast passes 80 percent and when spending passes 100 percent.
- How: Create the budget in the [account baseline](https://agentwranglers.se/playbook/infrastructure/environments/account-baseline), so no account starts without one. Send alerts to a team channel or group address, never one person. Turn on the provider's cost anomaly detection for jumps inside the month. On sandbox and preview accounts, add an action that stops spending when the budget runs out.
- Check: Every account in the organization has a budget with both alerts. A test alert reaches the team channel.

Example:

```hcl
resource "aws_budgets_budget" "monthly" {
  name         = "shop-production-monthly"
  budget_type  = "COST"
  limit_amount = "2000"
  limit_unit   = "USD"
  time_unit    = "MONTHLY"

  notification {
    comparison_operator       = "GREATER_THAN"
    threshold                 = 80
    threshold_type            = "PERCENTAGE"
    notification_type         = "FORECASTED"
    subscriber_sns_topic_arns = [aws_sns_topic.cost_alerts.arn]
  }

  notification {
    comparison_operator       = "GREATER_THAN"
    threshold                 = 100
    threshold_type            = "PERCENTAGE"
    notification_type         = "ACTUAL"
    subscriber_sns_topic_arns = [aws_sns_topic.cost_alerts.arn]
  }
}
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/budgets-for-every-account`.

- Previous: [Tag every resource with its owner](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/required-tags)
- Next: [Delete resources that sit idle](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership/delete-idle-resources)
- [Cost and ownership](https://agentwranglers.se/playbook/infrastructure/cost-and-ownership)
