Sub topic 13
Why a Budget Is an Alert, Not a Spending Cap
This chapter assumes you have already created your account, protected the root user with MFA, and set up a separate admin identity. You should be comfortable running AWS CLI commands and reading JSON. By the end, you will know how AWS Budgets decides when to alert, why it cannot stop spending by itself, and which extra controls shrink the gap between a cost surprise and your response.
The Misconception
Many new users create a budget of 20 USD and assume AWS will refuse to bill them beyond 20 USD. It will not. A budget is a monitor. It compares your spend to a number you chose and sends a notification when a threshold is crossed. Nothing is shut off, and resources keep running and billing.
Three facts explain this:
- AWS has no account-wide hard spending limit. Services are billed independently by usage.
- Cost data arrives with a delay. Budgets can only react to the data they have.
- Stopping resources can destroy work. AWS does not delete or stop your workloads on its own because a number was crossed.
How Budgets Evaluate Spend
AWS Budgets reads the same cost and usage data that feeds the Billing console. That data is not real time. Budgets refreshes its figures several times a day (AWS documents up to three updates per day), and some charges appear later than the usage that caused them. Examples are data transfer and certain usage-based services.
The result is a lag between an expensive mistake and the alert about it.
Treat the alert as a smoke detector. It tells you something is wrong, usually hours after the problem started, and a person or an automated action must then respond.
Actual and Forecasted Alerts
Each budget can have several notifications. Two types matter:
| Notification type | Fires when | Best use |
|---|---|---|
| ACTUAL | Spend already recorded passes the threshold | Confirming you have crossed a line |
| FORECASTED | AWS predicts that spend will pass the threshold by the end of the period | Early warning, before the money is spent |
A forecast needs usage history to be reliable. AWS needs roughly five weeks of data before it can forecast, so on a brand-new account a forecast alert may not fire at all. Do not rely on forecasts alone in your first weeks.
A sensible layered setup uses these notifications:
- ACTUAL at 50 percent, as a routine check-in.
- ACTUAL at 80 percent, which is the alert from the earlier chapter.
- FORECASTED at 100 percent, to catch a trend before the month ends.
- ACTUAL at 100 percent, as the final signal that the budget is gone.
Building the Layered Budget
Reuse budget.json from the previous chapter:
{
"BudgetName": "monthly-cost-budget",
"BudgetLimit": { "Amount": "20", "Unit": "USD" },
"TimeUnit": "MONTHLY",
"BudgetType": "COST"
}Replace notifications.json with a version that has two ACTUAL thresholds and one FORECASTED threshold:
[
{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 80,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
},
{
"Notification": {
"NotificationType": "ACTUAL",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 100,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
},
{
"Notification": {
"NotificationType": "FORECASTED",
"ComparisonOperator": "GREATER_THAN",
"Threshold": 100,
"ThresholdType": "PERCENTAGE"
},
"Subscribers": [
{ "SubscriptionType": "EMAIL", "Address": "[email protected]" }
]
}
]Create the budget. The account ID is a placeholder, so use your own. The command returns no output when it succeeds.
aws budgets create-budget \
--account-id 111122223333 \
--budget file://budget.json \
--notifications-with-subscribers file://notifications.jsonThen confirm that AWS stored what you intended. Never assume a silent success means the right configuration.
aws budgets describe-budget \
--account-id 111122223333 \
--budget-name monthly-cost-budget
aws budgets describe-notifications-for-budget \
--account-id 111122223333 \
--budget-name monthly-cost-budgetThe second command should list three notifications. If a threshold is missing, the JSON file was probably malformed or you edited the wrong copy.
What Counts as Spend
The budget compares your limit to a cost figure, and that figure depends on settings you may not have looked at. A cost budget can include or exclude items such as taxes, support charges, upfront fees, credits, and refunds. These settings are part of the budget's CostTypes.
Two edge cases follow:
- If credits are applied, a budget that includes them shows a lower number than the charges generated. Your real usage may be well above what the budget shows. When credits expire, the same usage suddenly looks much more expensive.
- Charges that you consider "not mine", such as tax or support plans, can push you over a threshold.
Open the budget in the console, review the cost types, and decide deliberately. For a learning account with promotional credits, consider also watching the unblended or usage view in Cost Explorer so the credit does not hide runaway usage.
Common Failure Modes
| Symptom | Likely cause | Fix |
|---|---|---|
| No email ever arrives | Wrong address, spam filter, or the alert never fired | Check the address with `describe-notifications-for-budget`, add the sender to allowed mail, and test with a low threshold |
| Alert arrives after the money is gone | Billing data lag | Add FORECASTED alerts, use anomaly detection, and review spend more often |
| Forecast alert never fires | Not enough history on a new account | Rely on ACTUAL alerts until history builds |
| Budget shows low spend despite heavy usage | Credits included in the budget | Review `CostTypes` and track usage without credits |
| Alerts go to one person who is on leave | Single subscriber | Add a shared mailbox or an SNS topic |
| Budget covers one service only | Filter applied to the budget | Check filters for service, region, or tag |
Going Beyond an Alert
If you want the system to react, you have options. None of them is instant, and none is a true cap.
- Budget actions. A budget can run an action when a threshold is crossed. It can attach an IAM policy or a service control policy, or stop specific EC2 or RDS instances. You must give Budgets an IAM role to act on your behalf. Test it carefully, because a policy that denies actions can also block your own recovery work.
- SNS notifications. Sending the alert to an Amazon SNS topic lets you trigger a Lambda function, a chat message, or a pager. This is the usual building block for custom responses.
- AWS Cost Anomaly Detection. This service looks for unusual spending patterns and can alert on a sudden spike even when you are under the budget total.
- Service quotas and guardrails. Limits on the number or size of resources you can create reduce how fast cost can grow. Least-privilege permissions for daily identities also help, because an identity that cannot launch large instances cannot make a large mistake.
Choose among them by asking what you can tolerate. If a 50 USD surprise is acceptable but a 5,000 USD one is not, an email alert plus a weekly review may be enough. If nobody watches the inbox, automate a response, and accept that automation can interrupt something you wanted running.
Checking for Leaks Directly
When an alert arrives, find the source quickly. In the Billing console, open Cost Explorer and group by service, then by region. Unfamiliar regions are a red flag, and so are services you never used. The aws sts get-caller-identity command, shown earlier, helps confirm you are working in the account you think you are.
If the cause is not your own forgotten resource, treat it as a possible compromise. Check for unknown IAM users or access keys, rotate credentials, and review the credential report. Compromised keys are a common cause of sudden cost, which is one more reason to keep root access keys absent.
Exercise
You set a 20 USD monthly budget with an ACTUAL alert at 100 percent. You launch a large instance on the 3rd and forget it. The alert email arrives on the 9th, when spend is already 90 USD. Did the budget fail? What two changes would reduce the damage next time?
Show answer
The budget worked as designed. It is an alert, not a cap, and it depends on billing data that arrives with a delay, so it cannot prevent spending or react instantly. To reduce damage, add earlier notifications such as ACTUAL at 50 and 80 percent and a FORECASTED alert at 100 percent, and add a response path, for example an SNS topic that triggers a notification workflow or a budget action. Also review running resources regularly and delete anything you no longer use.
Exercise
Which command confirms that the three notifications you defined were actually stored on the budget named monthly-cost-budget?
Show answer
aws budgets describe-notifications-for-budget --account-id 111122223333 --budget-name monthly-cost-budget (using your own account ID).