I made a $500 mistake but you don't have to.
Tags: aws, tutorial
Published: 2020-04-07 16:07:34

---
title: I made a $500 mistake but you don't have to.
published: true
description: Learn how to use AWS Budget and Set up a cost budget
tags: AWS, tutorial
---

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](https://dev.to/dabit3) posted: [Building a Serverless Live-streaming Platform with React & AWS](https://dev.to/aws/building-a-serverless-live-streaming-platform-with-react-aws-1jmk).

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.

![My first AWS billing alerts](https://dev-to-uploads.s3.amazonaws.com/i/qqw4fm6riudqt5ypr7j7.png)

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.

![I've made a huge mistake](https://media.giphy.com/media/G4rIGiMVtrJ1S/giphy.gif)

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](https://dev.to/dabit3). 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](https://dev.to/mrsamsa42/comment/n4j4). _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.

![AWS Cost Explorer](https://dev-to-uploads.s3.amazonaws.com/i/i2je4kc8ysx5hzqc0a6w.png)

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.) 

![AWS Budget type](https://dev-to-uploads.s3.amazonaws.com/i/qanii3pn21vxpn5hm39i.png)

- 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.

![Configure alerts for your budget](https://dev-to-uploads.s3.amazonaws.com/i/dqrrb88mro2adshe0hl9.png)

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](https://twitter.com/jimcalliu).

Stay home & stay healthy.