The AWS Console provides users with a UI to access spend the data. Many users use third party tools to generate detailed reports and slice and dice spend data in a manner more appropriate for their environments. In order to get detailed cost reports customers need to enable detailed reporting. AWS then dumps detailed reports in S3 buckets specified by the user. It is a major pain to parse through data that could have millions and millions of records, but that is what Cloud cost management/reporting tools used to do. AWS recently announced Cost Explorer APIs that provide programmatic access to cost data which makes accessing cost data much simpler (Just an API instead of parsing through millions of data records!).
Many users might still just want a simple command line tool to fetch their cost information, so that they can integrate cost data with their internal tools.
I’m pleased to announce an open-source Cost Reporter tool that allows users to view their spending and cost information from the command line, and dump it into CSV and JSON formats to be imported into other programs for further analysis. It is not a tool with extensive capabilities, but might be a good start for those that want to experiment with programmatic access to AWS cost data.
You can download the Cost Reporter tool here: https://github.com/FittedCloud/costreporter
In order to use the tool, your account must be set up with the proper permissions to view Billing data. To do this, set up an IAM policy with Billing enabled (IAM > Policies > search for Billing). You need to enable the read permissions: ViewBilling, ViewPaymentMethods, and ViewUsage.
Costs can be requested and grouped by different criteria, falling into the two categories of “dimension” and “tag”. Dimensions can be, for example, “SERVICE” or “INSTANCE_TYPE”. A full list of supported dimensions can be found by running the costreporter with the –help option.
You may also choose to group results by “tag”, which may be the value(s) of any tags you want to specify. By default, the tool will group costs by the “SERVICE” dimension and display a summary of cost information.
You can use the -j or –json option to dump more detailed results in JSON format, or the -c or –csv option to dump more detailed results in CSV format.
Using the CSV or JSON formatting allows you to import the data into your favorite analysis tool for further examination.
This open-source tool adds to our continuing list of open-source software we make available at FittedCloud:
FittedCloud Cloud Cost Optimization Solutions
FittedCloud offers machine learning based cloud cost optimization solutions that help customers reduce AWS spend significantly. Our current solution includes machine learning driven actionable advisories with click through actions for EC2, EBS, RDS, DynamoDB, ElastiCache, ElasticSearch, AutoScale, Lambda, etc. and full/lights out automation for EC2, EBS, DynamoDB and RDS. Our solution typically can save customers up to 50% of their cost on AWS. For a 14-day Premium free trial, please visit https://www.fittedcloud.com/register-now/.