Sub topic 5
Budgets and alerts
A budget tells AWS how much you plan to spend. An alert tells a person when spend is heading past that plan. This chapter covers how to build both so the right owner hears about a problem while there is still time to act.
This chapter assumes you can run the AWS CLI, read JSON, and have a tagging scheme or at least know what cost allocation tags are (see the earlier chapters on cost visibility and tagging). You also need permission to call budgets:* actions.
What a budget is
An AWS Budget is a named limit over a time period, with a set of notifications attached. It does not stop spending by default. It measures, compares, and notifies.
A budget has four parts:
- Type. What is measured.
COSTis the most common. Other types areUSAGE,RI_UTILIZATION,RI_COVERAGE,SAVINGS_PLANS_UTILIZATIONandSAVINGS_PLANS_COVERAGE. The last four track how well you use commitments, which a later chapter covers. - Limit and period. An amount and a
TimeUnitofDAILY,MONTHLY,QUARTERLYorANNUALLY. - Scope. The whole account, or a filtered slice such as one service, one linked account, or one tag value.
- Notifications. Up to five per budget. Each has a threshold, a comparison, and subscribers.
Creating a monthly cost budget
The CLI takes the budget and its notifications as separate JSON files. First, the budget definition:
{
"BudgetName": "monthly-total",
"BudgetLimit": { "Amount": "1000", "Unit": "USD" },
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}Next, a notification that emails a subscriber when actual spend passes 80 percent of the limit:
[
{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
}
]Then create the budget. Replace the account ID with your own:
aws budgets create-budget \
--account-id 123456789012 \
--budget file://budget.json \
--notifications-with-subscribers file://notifications.jsonBudgets live in the us-east-1 endpoint behind the scenes, but the CLI handles that. If the command fails with an authorization error, check the IAM permissions of the caller first.
Actual versus forecasted alerts
The NotificationType field has two values, and they answer different questions.
| Type | Fires when | Best for |
|---|---|---|
| `ACTUAL` | Spend so far crosses the threshold | Confirming a limit was reached |
| `FORECASTED` | AWS predicts that end-of-period spend will cross the threshold | Early warning while you can still change course |
An ACTUAL alert at 80 percent of a monthly budget might arrive on day 25, which leaves five days to act. A FORECASTED alert at 100 percent can arrive on day 8 if usage is climbing fast. Use both. A common layout is:
ACTUALat 50 percent, for awareness.ACTUALat 80 percent, for the owner to review.FORECASTEDat 100 percent, for early warning.ACTUALat 100 percent, to trigger escalation.
Forecasts need history. AWS needs roughly five weeks of usage data on an account before it produces forecasts, so a new account will not fire FORECASTED alerts at first.
How an alert reaches a person
Email is simple but easy to ignore. An SNS topic lets one alert reach several places, including a chat channel through AWS Chatbot or a Lambda function that opens a ticket. A single notification can have up to 10 subscribers in total, mixing email addresses and SNS topics. To use SNS, the topic's access policy must allow the budgets.amazonaws.com service principal to publish to it. Missing that policy is the most common reason an SNS alert never arrives.
Scoping budgets to owners
One account-wide budget tells you something is wrong but not who owns it. Add narrower budgets that match your allocation scheme. This is where tagging pays off. If every resource carries a team tag that is activated as a cost allocation tag, you can budget per team:
{
"BudgetName": "team-payments-monthly",
"BudgetLimit": { "Amount": "250", "Unit": "USD" },
"TimeUnit": "MONTHLY",
"BudgetType": "COST",
"CostFilters": {
"TagKeyValue": ["user:team$payments"]
}
}The user: prefix marks a user-defined tag, and the $ separates the key from the value. You can also filter by Service, LinkedAccount or Region. Send each scoped budget's alerts to the team that owns the spend, not to a central inbox. Someone who can change the resource must be on the subscriber list.
Budget actions
Budgets can also act, not only notify. A budget action runs when a threshold is crossed. It can apply an IAM policy or a service control policy to restrict what a user, group or role can do, or it can stop specific EC2 or RDS instances. Actions can run automatically or wait for manual approval.
Use actions carefully:
- Stopping instances is safe for development environments and dangerous for production. Apply actions only to scopes where an interruption is acceptable.
- Restricting an IAM policy blocks new spending, such as launching instances. It does not stop resources that are already running and billing.
- Test the action's IAM role first. An action that fails to run still leaves you with only an alert.
For production, prefer approval-required actions, or send the alert to a human with the context to decide.
Finding the right numbers first
Do not guess a limit. Start from real spend. The Cost Explorer API shows last month's cost grouped by service:
aws ce get-cost-and-usage \
--time-period Start=2026-10-01,End=2026-11-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICESet the first budget a little above the recent normal, then tighten it as you remove waste. A budget set far above real spend never fires. A budget set far below it fires every month, and people learn to ignore it.
Common errors and design gotchas
- Alert fatigue. Five alerts per budget on a dozen budgets produce noise. Give each alert a distinct purpose and a named responder.
- Wrong subscriber. Alerts sent to a former employee's address, or to a shared mailbox nobody reads, are the same as no alert. Review subscriber lists on a schedule.
- Unconfirmed SNS subscription. An email subscribed to an SNS topic must confirm before it receives anything.
- Linked accounts. In AWS Organizations, only the management account (or a delegated administrator) can create budgets that cover other member accounts. A member account sees only its own spend.
- Credits and refunds. By default, budgets can count spend before credits are applied, depending on the budget's settings. If a credit hides real spend, check the budget's cost type settings so the alert reflects what you want.
- Wrong metric.
UnblendedCostand amortized cost differ when you have upfront commitments. Pick the one that matches how your finance team reports costs. - One budget for everything. A single total budget cannot tell you which team caused an overrun.
Budgets themselves are cheap, but action-enabled budgets can carry charges after a free allowance, so check current AWS pricing before creating many of them.
Exercise
Your team has a monthly budget of 1000 USD. Spend is climbing quickly in the first week, and you want a warning before the month's actual spend reaches the limit. Which notification type should you add, and why does it matter that an ACTUAL alert alone is not enough?
Show answer
Add a FORECASTED notification, for example at 100 percent of the budget. AWS predicts end-of-month spend from current usage, so the alert can fire in the first or second week. An ACTUAL alert fires only after spend has already crossed the threshold, which may leave only a few days to react. Remember the forecast needs about five weeks of account history before it works.
Exercise
You created a budget with a tag filter user:team$payments, but it reports 0 USD even though the payments team is running instances. Name two likely causes.
Show answer
First, the team tag may not be activated as a cost allocation tag in the Billing console, so the tag does not appear in billing data. Second, the resources may be untagged or tagged with a different key or value, such as Team or Payments, because tag keys and values are case sensitive. Activation also does not apply to spend from before the activation date.