Lab: cloud budgets and cost alerts on AWS, Azure and Google Cloud
In short: A budget is the first thing to create in any new cloud account. You set a small monthly limit with alerts at several thresholds, check that an alert email really arrives, and remember that budgets only warn: you still have to delete resources yourself.
Aim and what you need
Students regularly receive surprise cloud bills from a forgotten virtual machine, a NAT (network address translation) gateway or a public IP address left running after a lab. The aim of this lab is to make sure you hear about spending early. You will create a monthly budget with alerts at 50%, 80% and 100% of a small amount, such as 5 US dollars.
- Your own cloud account, with MFA turned on for the root or owner login.
- Access to the billing pages (on AWS, the root user may first need to allow IAM users to see billing).
- An email address you actually read.
- Optional: the AWS CLI, Azure CLI or Google Cloud CLI.
Steps
- Turn on MFA for the account owner if you have not already.
- On AWS, open Billing and Cost Management, Budgets, and choose the zero-spend or monthly cost template, or use the CLI with two small JSON files.
- On Azure, open Cost Management, Budgets, add a monthly budget on your subscription and set alert conditions at 50, 80 and 100% of actual cost, plus 100% of forecast.
- On Google Cloud, open Billing, Budgets and alerts, scope it to your project and add threshold rules.
- Also switch on free tier usage alerts where the provider offers them.
# AWS: budget.json
{ "BudgetName": "lab-monthly", "BudgetLimit": { "Amount": "5", "Unit": "USD" },
"TimeUnit": "MONTHLY", "BudgetType": "COST" }
# AWS: notifications.json (one entry per threshold)
[ { "Notification": { "NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN",
"Threshold": 80, "ThresholdType": "PERCENTAGE" },
"Subscribers": [ { "SubscriptionType": "EMAIL", "Address": "you@example.com" } ] } ]
aws budgets create-budget --account-id <account-id> --budget file://budget.json --notifications-with-subscribers file://notifications.json
aws budgets describe-budgets --account-id <account-id>
# Azure
az consumption budget create --budget-name lab-monthly --amount 5 --category cost --time-grain monthly --start-date 2026-11-01 --end-date 2027-10-31
az consumption budget list
# Google Cloud
gcloud billing budgets create --billing-account=<billing-account-id> --display-name="lab-monthly" --budget-amount=5USD --threshold-rule=percent=0.5 --threshold-rule=percent=0.8 --threshold-rule=percent=1.0
The Azure CLI command creates the budget; add the email alert conditions in the portal if your CLI version does not offer them.
How to verify
List the budget from the CLI or console and confirm the amount, period and recipients. To prove alerts arrive, temporarily create a second budget with a tiny limit such as 0.01, wait for the next billing refresh (often several hours) and check your inbox and spam folder. Then delete that test budget. On AWS the free tier page and on Azure the cost analysis view show what is costing money right now.
Troubleshooting and clean-up
- No email: billing data lags, so wait; also check the address and spam filter.
- Access denied on billing: on AWS, enable IAM access to billing as the root user, then use an IAM user.
- Costs still rising: budgets never stop resources. Search every region for running instances, load balancers, NAT gateways, disks, snapshots and public IPs.
Keep the main budget for as long as the account exists. After every lab, run a quick check: what did I create, and is it deleted? Tagging lab resources with a label such as project=lab makes this far easier.
Tip: for coursework, a screenshot of your budget and a short cost note at the end of each lab report shows good professional habits.
Practice
Does an AWS or Azure budget stop resources when the limit is reached?
Why set a forecast alert as well as an actual alert?
Name two lab resources that often keep charging after students think they have finished.
Key takeaways
- Create a budget before you build anything in a new account.
- Set alerts at several thresholds, including a forecast alert.
- Billing data lags, so alerts are never instant.
- Budgets warn only; delete resources yourself.
- Tag lab resources so clean-up is quick and complete.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.