Understanding how to manager your costs can be difficult in the cloud. For one thing, you have to keep track of how much you have spent with the obvious services, like EC2, Sagemaker and S3. On the other hand, how can you figure out how much you are being charged for your network (VPC)? Further, some Cloud Lab users are interested in understanding how to forcast cloud costs for a larger project. For example, if you want to understand the cost of calling somatic variants on 100 samples, but in Cloud Lab you plan to benchmark using five samples. How would you go about doing that? This guide aims to answer these questions.
One of the first steps to understanding costs is resource tagging. Billing reports will be aggregated across time and services, and it can be hard to figure out how much did that variant calling pipeline cost to run? Tagging allows you attach metadata to resources that you can later filter for in Billing reports. AWS has a comprehensive Tagging guide here You can add a tag to pretty much any resource but let's look at a few examples.
- Select the bucket and then click Properties.
- Scroll down to Tags and click Edit.
- Add a few tags that help identify the filtering you want to do later, feel free to look at the AWS guide for examples.
This assumes your instance already exists. You can also tag a new instance during creation using the same method.
- Select the instance and click the Tags tab, then Manage Tags.
- Add your tags, then click Save.
-
Select the Sagemaker instance and scroll down to Tags.
-
Click Edit, then add tags as described above.
You can find a lot of billing tools by searching for billing in the bar at the top of your console.
However, the best billing tool for Cloud Lab use is the cost explorer.
- Go to the (A) Console Home Page, then to (B) AWS Cost Management.
- Click on Cost Explorer on the left panel
- Click on (A) the data range, then (B) change the end date to today's date. By default it will show you billing to the end of last month so you won't see your current month charges.
- Filter for different parameters on the right. Here we can filter by Service to select only costs related to EC2.
Now we see only costs related to EC2.
- Filter for the tags we added in Part 1 to benchmark a specific analysis. In this case, we are going to select BLAST.
Now we can see the costs related to the analyses with the BLAST tag. If you don't see the tags you added before, make sure you have waited ~12 hours. AWS aggregates costs about three times per day, so those costs may have just not shown up yet.
- Explore the other options available. You can change the plot type, change the filtering, and use several other tools within Cost Management.
One way to help stay on budget is to create budget alerts. You can do this using the Budgets tool within Cost Management.
- Click Create a budget.
- Select your budget type. We recommend Cost budget. Click
Next
.
- On the next page, enter a Budget Name. Under budget amount, select Annually for Period. Under Budget renewal type select Expiring budget. For Budgeting method select Fixed and then type 500 for the Budget Amount.
- You can leave the rest as default and then click Next
- Click Add an alert threshold
- Configure your budget alerts as desired. Here we set one alert for when the budget reaches 50%, but you could set several alerts to let you know when you have reached 25%, 50%, 75% and then 95% for example.
- Click Next. On the following page, click Create Budget