The AWS Console provides users with a UI to access cloud spend data. Many organizations use third party tools to generate detailed reports and slice and dice spend data in a manner more appropriate for their environments (or  leverage AWS Cost Explorer APIs  for programmatic access to cost data).

In the whitespace between these choices, there is a demand for a command line tool to fetch cost information and integrate it into a costing tool. Let us fill that whitespace.

The open-source Cost Reporter tool allows users to view their spending and cost information from the command line, dump it into CSV and JSON formats, and export into other program for analysis.  Full disclosure: it does not have extensive capabilities. But it is a  good place to start experimenting with programmatic access to AWS cost data.

 

Access the tool:

  • Set AWS account with view billing data permission.
  • Set IAM policy with Billing enabled (IAM > Policies > search for Billing). 
  • Enable the read permissions: ViewBilling, ViewPaymentMethods and ViewUsage
  • Request and group costs by “dimension” and “tag”. A full list of supported dimensions can be found by running the costreporter with the –help option.

 

Screenshot of Fittedcloud Cost Reporter tool - showing a list of supported dimensions.
A full list of supported dimensions can be found by running the costreporter with the –help option.
Screenshot of Fittedcloud Cost Reporter tool - showing cost summary information.
By default, the tool will group costs by the “SERVICE” dimension and display a summary of cost information.
Screenshot of Fittedcloud Cost Reporter tool - showing cost summary information.
Use the -j or –json option for more detailed results in JSON format, or the -c or –csv option for more detailed results in CSV format.
Screenshot of Fittedcloud Cost Reporter tool - showing cost summary information.
Using the CSV or JSON formatting allows you to import the data into your favorite analysis tool for further examination.

Editor's note: This post was originally published on the now retired FittedCloud blog (January 2018).

 

Download 4 steps to successfully monitor and optimize hybrid IT

A hybrid IT approach offers the best of both on-premises and public cloud by keeping costs and risk low while increasing efficiency and speed. But monitoring and optimizing hybrid environments is complicated. 

 

Try Apptio Cloud Business Management for Free for 14 days

Apptio® Cloud Business Management provides cost and resource optimization capabilities across all leading public cloud providers (AWS, Azure and Google Cloud) so IT leaders can increase the efficiency of public cloud spending and slash waste from over-purchase and underuse. Submit your information to request a 14-day free trial of the cloud cost optimization component of Apptio Cloud Business Management.

 

»Read next on Emerge: