As a #BetaTester, I spent a lot of my free time try and tinker with new technology. With all the Stay-Home-Stay-Health mandate, I was attracted by the tutorial Nader Dabit posted: Building a Serverless Live-streaming Platform with React & AWS.
Within minutes of clicking, installing, and typing all the code by hand (my recommendation if you actually do want to learn how to write code through tutorial. Even if you type while looking at the tutorial's code example, your brain is still try to comprehend and your typing reinforce some muscle memories.), I was able to see my giant face in the browser through running a local server.
I thought, "this is sweet!" Before I could tinker further, my 3yr old son had a bathroom emergency. I rushed out of my office without turning anything off.
That was Saturday afternoon, and while I did return later to the office to shut down my laptop & lights, I closed my laptop without thinking further.
Sunday morning March 29th, I woke up with the my first AWS billing alert.
As you can see, previously I have set this to $60, which is nice that I have an alert. But I didn't even want to pay $60 for a service I was trying for tutorials. I realized I was still running that local instance through my terminal. I shut it off and went on my day.
One thing you have to remember about the AWS billing alert, is that it only gives you ONE alert and it won't keep alerting you. Even if your bill keep climbing. At the same time I made a mistake of not following up to check when my shutting off local instance did the trick. With all the COVID-19 news going on around the world, and how my workplace was impacted, I had a lot on my mind.
The next time I get the alert on April 2nd (the email alert technically sent out close to midnight the previous day), I already spent another $100 in April, and accumulatively spent over $500 dollars on my AWS bills. I realized my daily cost have been $100 plus and I only get this second alert because it is a new month.
It's quite embarrassing for someone who had work with AWS technology professionally for more than 4 years to make such rookie mistakes. Instead of hiding under my bed while paying AWS, I decided to write this up for my Internet friends, so you don't have to make the same mistake like mine.
By the way, I do want to give a shut out to Nader. He was very responsive to my question and quickly add a disclaimer in the original post, to help remind everyone that this service is not like many other AWS services that come with a free tier. I will keep encourage you all consume his high quality, educational content.
Mistake was made, what now?
On the part that was really costly: AWS MediaLive, I had to try to (stopping or deleting the channel](https://docs.aws.amazon.com/medialive/latest/ug/starting-stopping-deleting-a-channel.html). Later I discovered another fellow Dev had mentioned this. I should have read the comment on the internet article.
Another way you could stop the cost to pile up, is to have a good hygiene on leveraging CloudFormation and tear down the stacks after you finished the tutorial or no longer want the AWS services to be running. Not ever AWS services/tutorial is through CloudFormation template, so this part does require some understanding of how your application leverage AWS services.
Like I mentioned, you could also setup AWS billing alert, and you should regardless if you care about money. Even when every penny you spent on technology infrastructure was worth it, you want to be able to analyze the cost and trade-off. AWS invested in the Cost Management and Billing section of AWS Billing over the years, as well as Cost Explorer that bring visualization for your cost reports. You will look smart by leveraging those tools instead of realizing how much you spent by looking at credit card bills.
To fully take advantage of what AWS billing provides, you can quickly do the following:
- Create Budget: You could budget for either Cost or Usage. (You can also do reservation budget and savings plan budget. Those are topics for another day, and let me know if you are interested in learning about those.)
- Configure Alerts: although the alert only produces notification to you, it still serves an important role if you want to understand your usage in a timely fashion. Thankfully, you can also do Forecasted Costs so you don't have to wait until it exceeded your budget to get a notification.
That's it! You will get an email when your forecasted bill exceed your budget, and never have to worry about giant AWS bill in this nightmarish scenario.
Hopefully this post helps you to save the hard earn money while benefit from all the interesting tutorials on AWS services. If you have any feedback for me on this post, leave a comment or find me on Twitter.
Stay home & stay healthy.