Billing alarms and tagging, set up on day one
There is a rite of passage in AWS: the surprise bill. Someone leaves a large instance running, a misconfigured service loops, a test environment never gets torn down — and the end-of-month bill is a shock. Almost all of it is preventable with two things set up on day one: billing alarms so you find out early, and tagging so you can tell where the money goes. This lesson is those two foundations. It closes the account- foundations module, and cost is treated as first-class here because in practice it always is.
Why day one
Cost controls are worthless after the surprise bill — you set them up before, because the whole point is to catch problems while they are small. A runaway cost caught on day one via an alarm is a minor fix; the same cost discovered on the monthly invoice is weeks of waste. And tagging only helps if resources are tagged as they are created — retrofitting tags onto hundreds of existing resources is painful. So both belong in the very first setup of an account, before you run real workloads. This is the same "painful to change later" theme as account structure: do it up front, cheaply, or do it expensively later.
Billing alarms: find out early
You want to be told when spending crosses a threshold, not discover it at month end. AWS gives you two tools:
- AWS Budgets — set a monthly budget (a dollar amount) and get alerted when actual or forecast spend crosses thresholds (say, 50%, 80%, 100% of budget). The forecast alert is especially useful: it warns you early in the month that you are on track to overspend, before you actually do. Set a budget on every account.
- CloudWatch billing alarms — an alarm that fires when estimated charges exceed an amount, notifying you (via SNS to email or chat). A classic baseline: "alert me if this month's estimated charges exceed $X."
The habit: every account gets a budget and a billing alarm on the day it is created, with a sensible threshold and a notification that reaches a human. For a personal or dev account, even a low threshold (e.g. alert at $10) turns "I forgot I left that running" from a $200 surprise into a same-day email. This single practice prevents the majority of AWS bill shocks.
Tagging: know where the money goes
A tag is a key-value label you attach to a resource (Environment=production, Team=payments,
Project=greetings). Tags do nothing to the resource itself — their power is that AWS can group and report
costs by tag. Without tags, your bill is one lump: "EC2: $4,000" tells you nothing about which
environment, team or project spent it. With consistent tags, you can answer "what does production cost?", "what
is this team spending?", "how much is that experiment costing?" — which is the basis of all cost management.
A workable tagging approach:
- Decide a small set of mandatory tags up front — commonly
Environment(production/staging/dev),TeamorOwner, andProject(orCostCenter). A handful, applied consistently, beats dozens applied haphazardly. - Apply them at creation — ideally enforced through your Infrastructure as Code (the Terraform modules can set tags on everything automatically), so nothing is created untagged. This is where IaC and tagging combine: tag in the module, and every resource is tagged by construction.
- Activate cost allocation tags in the billing console so AWS breaks the bill down by them, and use Cost Explorer to slice spend by tag.
The payoff: a bill you can read by environment, team and project — which turns cost from a mystery into something you can attribute, question and reduce (the whole cost module builds on this). Untagged resources are the enemy of cost management; tagging from day one, enforced by IaC, keeps the bill legible as you grow.
The wider cost-awareness mindset
These two are the foundation, but they seed a mindset the course returns to throughout: cost is a first-class engineering concern, not an afterthought for finance. A few day-one habits that reinforce it:
- Turn off what you are not using. Non-production environments do not need to run overnight or at weekends; scheduling them off (scale-to-zero) can halve their cost. The cost module goes deep here.
- Watch for the classic leaks — an unattached Elastic IP, an idle load balancer, an over-provisioned instance, storage from deleted resources, data-transfer charges. (The cost module's "common waste" lesson catalogues these.)
- Review the bill regularly — a short monthly cost review (the cost module) catches drift before it compounds.
Setting up billing alarms and tagging on day one is the small, cheap act that makes all of that possible: you find out early when something is wrong, and you can see where the money goes. Skip them, and you are flying blind toward a surprise bill; do them, and cost becomes something you manage deliberately from the start — which is exactly how production AWS should be run.
Check your work
Why day one: cost controls only work before the surprise — a runaway caught early is a minor fix, found at month-end it is weeks of waste; and tagging only helps if applied at creation (retrofitting is painful). Set both up before real workloads. "Painful to change later" again.
Billing alarms: AWS Budgets (monthly budget with actual and forecast alerts at 50/80/100% — the forecast warns you're on track to overspend) and CloudWatch billing alarms (fire when estimated charges exceed $X, notify via SNS). Every account gets one on creation; even a $10 dev threshold prevents most bill shocks.
Tagging: key-value labels (Environment, Team, Project) that let AWS group and report cost by tag —
without them the bill is an unattributable lump. Decide a small mandatory set, apply at creation via IaC
(tag in the Terraform module → everything tagged by construction), activate cost-allocation tags, slice in Cost
Explorer.
Cost-awareness mindset: cost is a first-class engineering concern. Day-one habits: turn off non-prod overnight/weekends (scale-to-zero), watch classic leaks (idle Elastic IPs/LBs, over-provisioning, orphaned storage, data transfer), review the bill monthly. Alarms + tags make all of it possible.
Practice
- Explain why billing alarms and tagging must be set up on day one rather than added later.
- Set up (or describe setting up) an AWS Budget with forecast alerts, and explain why the forecast alert is valuable.
- Choose a small mandatory tag set for a team and justify each tag.
- Explain how Infrastructure as Code makes tagging reliable, and why untagged resources undermine cost management.
- Describe how you would answer "what does production cost this month?" using tags and Cost Explorer.
- List three classic AWS cost leaks that day-one awareness would help you catch.
Official documentation
- AWS — Creating a budget (AWS Budgets) — Budgets with actual and forecast alerts.
- AWS — Tagging your resources & cost allocation tags — Using tags to attribute and report cost.
- AWS — Best practices for tagging AWS resources — A consistent tagging strategy.
Next: the Networking module — VPC design you will not have to unpick in a year.
Stuck on this lesson?
Being stuck is part of it — but being stuck alone for three days is not. Our internship programme pairs this curriculum with code review and one-to-one help from working developers, and it is free.
About the internship