A monthly AWS budget works best when the first alert gives someone time to investigate. A forecast alert can surface a rising trend, while an actual-spend alert confirms that recorded charges have crossed a threshold. This guide creates a notification-only monthly budget and checks the routing before relying on it.
Choose a scope and two thresholds
Use the following example in a sandbox account. It uses USD 50 as an illustrative monthly limit, an actual alert above 80%, and a forecast alert above 100%. Use a limit that reflects the sandbox’s normal spend and the amount you can investigate. In a management account with consolidated billing, review the cost scope carefully before creating a budget. An unfiltered budget may be broader than the individual workload you intend to monitor.
- Install AWS CLI v2 and
jq. Use credentials permitted to create, describe, and delete the lab’s budget. - Choose an email address that you control for the lab. The service may send a verification message to newly added recipients.
- Confirm the account with
aws sts get-caller-identitybefore setting the budget scope.
Create the budget and notifications
Keep the same shell open for verification and cleanup. Replace the example email address with your own before running these commands. The account, budget, and notification arguments are explicit so you can audit the setup later.
ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
BUDGET="techmandra-sandbox-$(date -u +%Y%m%d%H%M%S)-$$"
EMAIL="replace-with-your-email@example.com"
BUDGET_JSON=$(jq -cn --arg name "$BUDGET" '{
BudgetName: $name,
BudgetType: "COST",
TimeUnit: "MONTHLY",
BudgetLimit: {Amount: "50", Unit: "USD"}
}')
NOTIFICATIONS_JSON=$(jq -cn --arg email "$EMAIL" '[
{Notification: {
NotificationType: "ACTUAL", ComparisonOperator: "GREATER_THAN",
Threshold: 80, ThresholdType: "PERCENTAGE"
}, Subscribers: [{SubscriptionType: "EMAIL", Address: $email}]},
{Notification: {
NotificationType: "FORECASTED", ComparisonOperator: "GREATER_THAN",
Threshold: 100, ThresholdType: "PERCENTAGE"
}, Subscribers: [{SubscriptionType: "EMAIL", Address: $email}]}
]')
aws budgets create-budget --region us-east-1 --account-id "$ACCOUNT" \
--budget "$BUDGET_JSON" --notifications-with-subscribers "$NOTIFICATIONS_JSON"
The actual alert triggers after recorded spend exceeds USD 40 for this example. The forecast alert uses the estimated monthly total. These notifications do not impose a spending cap. AWS CLI budget creation reference.
Verify the budget and the recipient
aws budgets describe-budget --region us-east-1 --account-id "$ACCOUNT" \
--budget-name "$BUDGET" \
--query 'Budget.{Name:BudgetName,Limit:BudgetLimit,Interval:TimeUnit}'
aws budgets describe-notifications-for-budget --region us-east-1 \
--account-id "$ACCOUNT" --budget-name "$BUDGET" \
--query 'Notifications[].{Type:NotificationType,Threshold:Threshold,Units:ThresholdType}'
Check that both returned thresholds match the intended values. In the AWS Budgets console, open the budget details and confirm the recipient is active. If the address is pending, follow the verification email or resend it from the console. A configured threshold and an active recipient are two separate checks. AWS Budgets email verification.
Troubleshoot and close the loop
- There is no forecast. A new account or workload may have too little cost history. Keep an actual threshold and check the budget again as usage accumulates.
- The email never arrived. Confirm recipient status, check the spam folder, and verify that the account’s IAM policies and organization rules allow the required email verification actions.
- The bill changed before the alert arrived. Billing and budget evaluations are delayed. Use workload-specific measures, such as scaling limits or request monitoring, where a quick response matters.
Decide who owns the first response. A simple runbook can start with the service, Region, and usage type that changed, then assign a follow-up to the workload owner. Review charges before enabling optional actions. Managing costs with AWS Budgets.
Remove the lab budget
When finished, check the displayed name and delete only the budget created above.
printf 'Lab budget: %s in %s\n' "$BUDGET" "$ACCOUNT"
aws budgets delete-budget --region us-east-1 \
--account-id "$ACCOUNT" --budget-name "$BUDGET"







Leave a Reply