Bearclaws
Analyze the output of you AWS cost allocation report. Group your costs by an arbitrary tag, like client
.
Installation
Add this line to your application's Gemfile:
gem 'bearclaws'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bearclaws
CLI Usage
1) Download your cost allocation report from AWS (e.g. 93795-aws-cost-allocation-2013-09.csv
)
2) Identify the zero-indexed column in the CSV by which you want to 'group' things. (e.g. 31
)
3) Run the analyzer
$ bearclaws 93795-aws-cost-allocation-2013-09.csv 31
4) Examine the results in bearclaws.csv
. It will look something like this:
client1 | |
AWSDataTransfer | 191.32 |
AmazonEC2 | 39.10 |
AmazonS3 | 170.29 |
AmazonSNS | 0.00 |
AmazonRDS | 173.07 |
AmazonETS | 3.89 |
AmazonRoute53 | 1.01 |
Total | 578.68 |
client2 | |
AWSDataTransfer | 0.00 |
AmazonEC2 | 14.40 |
Total | 14.40 |
client3 | |
AWSDataTransfer | 0.01 |
AmazonEC2 | 14.40 |
Total | 14.41 |
CLI Options
-o
The name of the CSV output file. Defaults to bearclaws.csv
API Usage
csv = File.open '93795-aws-cost-allocation-2013-09.csv'
groups = Bearclaws.analyze csv, 31
groups.each do |group|
puts group.name # Name of the tag
puts group.total # Total cost attributed to the tag
group.subtotals.each do |key, subtotal|
puts %{#{key} - #{subtotal}}
end
end
Learn more in the docs