The cloud computing revolution has brought a lot of power to the everyday developer. That power, however, comes with a price.
No, I'm not going to a start philosophical excerpt. Cloud computing comes with a price tag in US Dollars, and just like the
not quite infinite resources available in the cloud, you can get your bill if you don't properly watch for your cloud spendings.
Let's see how we mitigate that risk.
The free tier is generous, but it can come to an end without you noticing.
Let's start by setting up an automated way to know about what's going your on your spendings with a Billing Alert.
To set up a billing alert, access your AWS Management Console, and find the Billing service:
If this is the first time you are accessing the AWS billing management, you should see a banner like the one bellow. Click Create a Budget to get started.
Most of the dashboard fields are self-descriptive, so I'll go over a simple recipe for what I think is a good starting budget planning:
If the idea is to track spendings, the shorter the billing cycle, the better.
Recurring budget: So budget renews on the first day of every month.
Budget amount: Fixed.
That means you will have the same budget for AWS every month.
Define your budget amount, keep the advance options section as it is, and move on to the next page.
On the Send alert based on section, select actual value.
-But what about Forecasted Costs? That sounds like a good idea!
Indeed, if you opt for having AWS forecasting your budget, they will try to estimate your next bill based on your current resources usage. However, AWS needs at least five weeks of usage to start forecasting.
If you select Forecasted Costs right away, your billing alert won't be triggered at all until they have collected enough data.
To handle that, you can set up the Alert threshold to a value like 75% of the budgeted amount, so in case you get a fast-growing bill, you will be notified before you go over 100%.
Fill in your best email, hit the create button, and your budget should now display in the dashboard:
Last, but surely not least
I said before that it was a good idea to set up your billing threshold alert to a value lower than 100%, so you could be notified before going over your desired budget.
That matters simply because you can spend more than what you budgeted. More, much more, orders of magnitude more.
The billing alert is just an alert, and AWS won't turn off any services for you.
Keep an eye on your spendings, and enjoy the cloud!