An AWS account with a single person is kept under control with a glance at the bill. With four or five people creating things, it is not. Each one creates "a small machine to test", "a copy just in case", "a database for a moment", and none of them sees what the others create. Nobody spends much; between all of them, the bill doubles in three months. And when it arrives, there is no way to know whose each dollar is.
The solution is not to forbid, but to give each person a monthly figure and make visible how much they have spent. It is the same as a company card with a limit: nobody takes offence, and it avoids 90 % of the surprises.
AWS has no "per-user budget" as such. It can be imitated with three pieces: a mandatory tag with the name of whoever creates each thing, a budget (Budgets) filtered by that tag, and an IAM policy that prevents creating without a tag. The steps below build it; the following sections explain how to decide the figures and what to count.
Before you start: what each thing means
- Tag
- A name = value pair you put on each thing you create in AWS (for example, Propietario = ana) so you can group spending by it later.
- Cost allocation tag
- A tag you have activated in Billing so that Cost Explorer and Budgets can filter by it. Without activating it, the tag exists but is useless for costs.
- Budgets
- The AWS tool for setting a monthly figure and receiving an email when actual or forecast spend exceeds it. It warns; it does not block.
- IAM
- The AWS users and permissions system. Each person has a user and permissions that say what they can create, view or delete.
- Policy
- A text in JSON format that grants or denies permissions in IAM. A deny policy always wins over any granted permission.
- Cost Explorer
- The AWS screen that shows spending in charts and lets you group it by service, region, account or tag.
- Actual spend and forecast
- What has already been consumed this month and what AWS calculates you will have consumed by month end at the current pace.
- Snapshot
- A copy of a disk or a machine. Charged per GB per month while it exists; it is the object that piles up the most without anyone noticing.
- Bucket
- An S3 "folder" where files are stored. You pay for the space and for what is downloaded.
Step by step
Decide the tag and tell everyone
Choose a tag name and a value format, and never change them: for example
Propietariowith each person's IAM user name (Propietario = ana). Write it down somewhere everyone can see. From now on, everything that gets created (machines, disks, snapshots, databases, buckets) carries that tag.Activate the tag as a cost allocation tag
In the AWS console, your account menu, Billing and Cost Management, section Cost allocation tags. Look for
Propietarioin the list of user-defined tags and click Activate. Until it is activated, Cost Explorer and Budgets cannot filter by it. It takes up to 24 hours to appear, and it only counts spending from the moment it is activated, not earlier.Create a budget per person in Budgets
In Billing and Cost Management, go to Budgets and click Create budget. Choose Customize, type Cost budget, period Monthly, fixed amount (for example
60dollars). Under Filters, choose the dimension Tag, keyPropietario, valueana. Name itpresupuesto-ana.In the alerts, add two: when the actual spend exceeds 80 % and when the forecast exceeds 100 %, with that person's email and yours. Repeat the budget for each person. The first two budgets in the account are free; beyond that, each costs a few cents a day.
Prevent creating machines without a tag
In IAM, Policies, Create policy, JSON editor. A deny policy like this one prevents creating an EC2 instance or a volume that does not carry the
Propietariotag:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": ["ec2:RunInstances", "ec2:CreateVolume"], "Resource": ["arn:aws:ec2:*:*:instance/*", "arn:aws:ec2:*:*:volume/*"], "Condition": { "Null": { "aws:RequestTag/Propietario": "true" } } }] }Attach the policy to the user group. With a similar condition (
StringNotEqualsonaws:RequestTag/Propietarioand the variable${aws:username}) you can force the value to be the user's own name, so nobody charges their machines to someone else. Each service has its own actions (rds:CreateDBInstance,lightsail:CreateInstances); start with EC2 and RDS, which is where the money is.Limit which sizes can be created
A budget warns, but it does not stop a 2-dollar-an-hour machine created on a Friday afternoon. Add another deny policy for
ec2:RunInstanceswith the conditionec2:InstanceTypeoutside a list (t3.micro,t3.small,t3.medium...). Whoever needs something bigger asks for it. In RDS the equivalent isrds:DatabaseClass.Review once a month
In Cost Explorer, group by the
Propietariotag. You will see one bar per person and another one, "No tag", with everything created by skipping the rule or before it was set. That bar is the to-do list: tag or delete. Spend ten minutes at the start of each month and go over the figures with the team. Transparency does more than any policy.
Why spending shoots up with several people
It is not bad faith or carelessness; it is that the AWS console gives no signal of what each click costs. Creating a machine does not show the monthly price, only the type. A snapshot does not warn you that it is charged forever. And each person sees the account as "theirs": they do not know there are already three test machines from other colleagues doing the same thing.
The three patterns that cost the most money:
- Create and forget. A machine for a two-day test that stays on for three months. It is, by far, the number one cause.
- "Just in case" copies. Snapshots before every change, which nobody deletes afterwards.
- Size for comfort. Choosing a machine four times bigger than needed "so it runs well", without knowing it costs four times more.
How to set the figure
Start from what is already being spent. Look at the last three months in Cost Explorer and split it mentally by person (if there are no tags, ask). Usually one or two people account for almost all the legitimate spend (production) and the rest is testing and development.
Separate two things: what is shared (production servers, the company database) and what is personal (what each person creates for their own work). The per-user budget applies only to the second. For a developer, a reasonable figure is between 30 and 100 dollars a month: enough for one or two small machines running during office hours and a handful of snapshots. For someone who only looks, zero.
Set the figure a little above what the biggest reasonable spender spends today, and lower it after two months if there is room to spare.
What to count in each person's budget
Everything that person creates that has a recurring cost:
- Machines on EC2 and Lightsail, by the hour or by monthly plan. Remember that in Lightsail a stopped machine is still charged.
- Disks of those machines, including the ones left loose when deleting them.
- Databases on RDS and Lightsail, which are usually the most expensive object a person creates.
- Snapshots, per GB per month while they exist.
- Buckets in S3: storage and, above all, what is downloaded from them.
- IPs reserved and not attached.
What you do not need to count at first: data transfer, CloudWatch logs, DNS queries. They are small and hard to attribute. Focus on what gets created with a button and forgotten.
One trap: Budgets counts the accumulated spend of the month. What someone created on the 2nd and deleted on the 3rd keeps adding up even though the object no longer exists.
What AWS cannot do
It is worth being honest about the limits of this setup:
- Budgets warns, it does not block. There are "budget actions" that apply a deny policy when a threshold is exceeded, but they are crude and arrive late: the money is already spent.
- Tags depend on people adding them. The IAM policy enforces it in EC2 and RDS, but not every service supports tagging at creation time, and automatic snapshots do not inherit the disk's tag.
- Lightsail tags, but its console does not enforce it, and what was created before activating the cost tag is not counted.
- It takes upkeep: each new person means a budget, a tag value and a review; each person who leaves, cleaning up what was theirs.
Even so, it is much better than nothing.
What can go wrong
The budget shows no spend at all
It is almost always that the tag is not activated as a cost allocation tag, or that you activated it less than a day ago. Check it in Billing. And remember it only counts from activation: the spend of the machines tagged last week does not appear retroactively.
There is a lot of "No tag" spend
That is normal in the first month. In Cost Explorer, group by service within "No tag" to see what it is: usually old machines, loose disks and snapshots. Tag them (in EC2 you can select several and add tags at once) or delete them. If the untagged spend is shared production, give it the tag Propietario = compartido and that is it.
Someone cannot create a machine
The deny policy is working: they are trying to create without a tag or with a size that is not allowed. In the console, the error says "not authorized ... with an explicit deny". Have them add the tag in the creation step (Tags section of the EC2 wizard) or choose a size from the list. If they really need something bigger, add it to the list in the policy.
Automatic snapshots carry no tag
Snapshots created by AWS Backup or Data Lifecycle Manager inherit tags if you configure it in the rule; Lightsail's automatic ones cannot be tagged. Count that spend as shared or work out separately how much they amount to (they are easy to spot in the bill, as "snapshot").
In Simplio
In Simplio the per-user budget is a box on each person's profile: one figure a month. Everything that person creates from Simplio (machines, databases, snapshots, buckets) is recorded under their name with its approximate cost and, if they delete it the same month, it is deducted. Each user sees how much they have spent and how much they have left before creating anything, and gets an email warning when approaching the cap; the administrator sees everyone on the Costs screen. No need to tag, activate anything in Billing or write policies.
Combined with per-user and per-object permissions (who can create, who can only view, who can delete what) and the activity log, you know at all times who created each thing and when.
The same task, in AWS and in Simplio
| In the AWS console | In Simplio | |
|---|---|---|
| Give each person a monthly cap | Mandatory tag, activate it in Billing, one budget per person, IAM policies: 6 steps and upkeep | One figure on each user's profile |
| Know what each person has created | Cost Explorer by tag, only what is tagged and since activation | What is created from Simplio is recorded under whoever created it, with its approximate cost |
| Prevent creating too much | Deny policies by machine size | Per-user and per-object permissions, and a warning when approaching the budget |