New – Cost Allocation for EBS Snapshots
Amazon Elastic Block Store (Amazon EBS) allows you to create persistent block storage volumes for your Amazon EC2 instances. The volumes offer consistent, low-latency performance and a choice of volume types. You can take snapshot backups of your EBS volumes, keep them for as long as you would like, and then restore them to a fresh volume.
AWS Billing and Cost Management provide you with tools and reports that you can use to track your spending. You can use Cost Allocation Tags to assign costs to your customers, applications, teams, departments, or billing codes at the level of individual resources.
Cost Allocation for Snapshots
Today we are adding cost allocation for EBS snapshots. While I expect AWS customers of all shapes and sizes to make good use of this feature, I know that enterprises will find it particularly interesting. They’ll be able to assign costs to the proper project, department, or entity. Similarly, Managed Service Providers, some of whom manage AWS footprints that encompass thousands of EBS volumes and many more EBS snapshots, will be able to map snapshot costs back to customer accounts and applications.
Tagging Snapshots and Generating Reports
Let’s walk through the process of tagging snapshots and allocating costs.
The first step is to implement a tagging regimen for your existing snapshots. You can create a script that calls the
create-tags command or write code that calls the
TagResources function. You can also use the Console’s Tag Editor to find the snapshots of interest across any number of AWS Regions:
I have a handful of snapshots and simply tagged some them by hand. My tag key is usage and the values are backup, dev, and metrics. Here are my snapshots:
Next, I need to tell AWS that the new tag key is being used for cost allocation. I open up the Billing Dashboard and click on Cost Allocation Tags:
Then I locate my tag in the list of user-defined tags, select it, and clicked on Activate:
AWS will deliver the first updated report within 24 hours, and will update Cost Explorer at least once per day after that (read Understanding Your Usage with Billing Reports to learn more).
I have two options. I can use Cost Explorer to explore the data visually, or I can create a usage report, download it into Excel and analyze it on my desktop. I’ll show you both!
Using Cost Explorer
I open up Cost Explorer, select the time range of interest, and filter by Usage Type Group, selecting EC2: EBS – Snapshots. Then I set the Group by option to Tag and choose my tag (usage) from the drop-down:
Then I click on Apply and inspect the report:
I can see my costs and my usage (measured in gigabyte-months) at a glance. I can also click on New report, enter a name, and save the report for reuse:
Creating a Cost & Usage Report
I click on Reports and Create Report, to create a report. I named it DailySnapshotUsage and set the Time unit to be Daily:
Then I point it at my jbarr-billing bucket, select ZIP compression, and click on Next:
I confirm my settings on the next page and click on Review and Complete to finalize my report. I check back the next day and my report is ready:
Analyzing the Cost & Usage Report Using Excel
I can also download the cost and and usage report and analyze it using Excel.
I switch to the S3 Console, open up the jbarr-billing bucket, and descend in to the folder structure to find my report:
Then I download and unzip the file, and open it in Excel:
I want to see only the tagged usage, so I scroll over to column DJ (resourceTags/user:usage) and use Excel’s Filter operation to choose the tags of interest:
Then I hide most of the columns and end up with line item costs:
I’m highly confident that your Excel skills are better than mine, and that you can do a far better job of analyzing the data!
Understanding Snapshot Costs
As you create your reports and analyze your EBS snapshot costs and usage, keep in mind that snapshots are created incrementally and that the first snapshot will generally appear to be the most expensive one. If you delete a snapshot that contains blocks that are being used by a later snapshot, the space referenced by the blocks will now be attributed to the later snapshot. Therefore, with respect to a particular EBS volume, deleting the snapshot with the highest cost may simply move some of the costs to a more recent snapshot. Read Deleting an Amazon EBS Snapshot to learn more.
This new feature is available now in all commercial AWS regions and you can start using it today.