Taking Control of Your AWS Billing
AWS provides tools that let admins not only track down unexpected costs, but also prevent billing surprises -- like the unexpected charge that Brien found on his credit card recently -- from happening in the first place.
Although I write this weekly column about Amazon Web Services (AWS), I don't personally use AWS in any sort of production capacity. It isn't that I think that there is something wrong with AWS -- it's just that I have never had the need.
Since everything that I do in AWS is related to my writing, I have an AWS account that is linked to the AWS free tier. That way, I can try out techniques and get screen captures for my columns without it costing me anything.
Imagine my surprise, however, when I opened my bank statements last week and noticed a charge from AWS.
It turns out the charge was related to the Database Migration Service (DMS). I had written something that required me to use this service and forgot to clean up after myself. The end result was that I was charged for the resources that I had consumed (the DMS operation that I was performing fell outside the scope of the free tier).
The surprise bill that I received raises two questions. First, how did I figure out what I was being billed for? Second, how could the unexpected charge have been prevented?
I have to confess that when I saw the AWS charge on my bank statement, I had absolutely no idea what the charge was in reference to. I wrote five AWS-related columns last month, plus a few more this month, before I received my bank statement. Furthermore, I had also written a couple of full-length articles related to AWS. My AWS use over the last six weeks or so has been widely varied, and the charge could have been related to just about anything.
Thankfully, AWS made it surprisingly easy to figure out what was going on. I simply logged in to the AWS console, clicked on my account name, and chose the Billing & Cost Management menu option, shown in Figure 1.
As you can see in Figure 2, AWS provides billing history information, as well as cost projections for the current month. More importantly, the current charges are itemized on a graph on the right side of the screen. As you can see, all of my charges were related to the DMS.
Having an itemized cost summary made it easy to figure out what to do to stop the charges. I simply went to the AWS console's main screen, clicked on DMS, and then worked my way through the tabs until I found the resources that I had forgotten to delete, as shown in Figure 3.
In a way, I consider myself lucky. My carelessness did not result in a huge bill. However, that has not necessarily been the case for everyone. I recently spoke to someone who had accrued hundreds of dollars in charges because of a forgotten AWS resource.
The good news is that AWS makes it possible to establish a budget. If you look back at Figure 2, you will notice a tab labeled Budgets. Clicking on this tab takes you to the screen that is shown in Figure 4, where you can create a budget and even attach notifications to your budget. It is worth noting, however, that you cannot create a budget instantaneously. It can take AWS up to 24 hours to set up a budget for you.
Creating a budget is a simple process. Enter a name for the budget, then choose a start date, end date and a budget. You must also specify what the costs are related to. You can choose to tie costs to an availability zone, a linked account, an API operation, a purchase option, a service or a tag. For example, Figure 5 shows a budget that is tied to the DMS service.
If you look at the lower portion of Figure 5, you will see the optional notification engine. This mechanism allows AWS to send an e-mail message to the addresses of your choosing when either the actual or the forecasted costs exceed a particular budget threshold. For example, you could choose to receive a notification if the forecasted cost for the month exceed 95 percent of your budget.
Ultimately, AWS has done a really good job of providing tools that allow admins to not only track down unexpected costs, but also to prevent billing surprises from happening in the first place.
About the Author
Brien Posey is a 21-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.