Cost Analysis

How do you guys analyze your costs? I am the finance guy so anything too technical will be lost on me (I can always buy the Cloud guys some beer though to get some help).

Previously we were exporting the Detailed Billing Report with Resources and Tags into an S3 bucket on a monthly basis. The lack of more frequent updates and the size of the file (70+ GB/month) made it less than ideal but I could get to what I needed utilizing Power BI to summarize the report.

With that report being deprecated and the Cost and Usage report (CUR) being the new standard, I would like to use the CUR, but I’m being told by corporate cloud ops that there is no longer a single monthly file, and that I would have to download and aggregate thousands of files each month to be able to get a view of the entire bill.

We do use a third party product called Cloudhealth to help analyze our costs but I have never been able to get a sufficient level of detail out of it without a lot of manual processing. Some of our products are legacy and single-tenant. As such there are thousands of individual environments that I want to be able to run analysis against and compare.

Do you all look at your costs? How do you handle it?

Even if you don’t use it directly, you could have a few key queries written for you to give your aggregate view back again in CSV.

Agree with above comment. Use Athena so you can do direct queries or leverage qucksight to create some useful dashboards. If you don’t want to build your own you could always buy one of the many fin ops tools out there. It’s easy to get lost in the data, but a must do unless you want costs to spiral. AWS is really good at billing for the services.

Edit: grammar

Well its like I tell my clients. It will probably cost you more for me to figure how how much it will cost than running it for a whole year. Just ball park it and scale to your needs.

So, you don’t have to aggregate thousands of files with the CUR. It creates new reports regularly (every ~10 hours or so for us), and each report is a full list of line items for the month. This can be a blessing and a curse depending on how you’re looking to use it.

Would be nice to see some typical queries on the CUR to get the ball rolling

The Cost Explorer service is also a decent alternative to get you fairly granular views without needing to get into Athena or a bigger data analysis pipeline. It’s gotten a lot more useful in the last year or 2, but the bigger benefit is I think I could give any dev/finance person access and they’d get some level of use out of it.

If you have enterprise support, then reach out to your TAM for help. Your TAM will walk you through Athena and cost explorer and might even help with sample queries.

Cost optimization workshops are also available from your account team.

With a 70GB billing file, this is very far behind OP.

Start by defining the question you’re trying to answer. You usually want to slice on a variety of axes that finance (you, in this case!) cares about. The tooling is secondary; figure out where the gaps are first.

Join r/FinOps

Cloudhealth is going to be your best option for what you want.

  • It aggregates all the billing data across all your accounts.
  • Will apply AWS discounts. Note this needs to be setup by Cloudhealth support as it’s not part of the standard AWS billing data.
  • Can few cost on a daily or monthly basis.
  • Can have annualized reports which is especially helpful if you have any prepay RI (reserved instances).
  • You can filter and group the reporting anyway you want based on accounts, resources, or any tag.
  • You can also give cost saving recommendations which I find a pretty good.
  • Once you get the reports you want you can save them and have them mailed to you on a schedule such as daily, weekly, or monthly.
  • If you are looking at costs by tags you do have to create the perspectives.

Cloudhealth is not the easiest tool to learn but it really is worth the effort. But the quickest way to get the reports you want would be to send what you where getting out of the S3 report to your Cloudhealth support and have them help you.

We use CloudHealth as well and generally find that it fills all the necessary analysis gaps from Cost Explorer. I’d be curious to hear an example where CloudHealth is cumbersome for your needs. My initial thought is that your tagging structure may be the issue and no matter what tools you use you’re going to be in the same situation.

Pacbot

And from there the query results go to Excel or Tableau. I spend more on Tableau than I do AWS every year.

I think you can get your billing reports sent to an S3 bucket. That way, you can spin up a machine in the same availability zone, access data quickly (and for free), and run some Python / Pandas / etc to your heart’s content.

That’s what we have done, but I don’t think we have a ton of billing data.

You may want to check out CloudCheckr, there’s a feature called Advanced Grouping that lets you slice and dice granular data.

On mobile, but…
I’m a TAM at AWS and work a lot with costs.

A lot of comments here go in the right direction, but if you were my customer, here’s what I’d recommend:

  1. Change your CUR report setup. You should create a new report, and switch from the Gzip CSV to the Parquet format, and enable the overwriting option, hourly granularity and resource ID logging.
  2. Give that new CUR a different name so it goes to a new path.
  3. Get someone to write you a quick python script to convert your old CURs into parquet format (that 70GB will drop A LOT, so you’re already saving money!!).
  4. Clear out the old CUR files (verify the new ones first!).
  5. Follow the guideshere and here to get from S3 to QuickSight.

A few explanations:
Parquet is a much more efficient format than CSV for storing data. This, plus setting the “overwrite” option will make the size of the data stored much smaller without losing any detail. It will also be faster to search.

Once you have Glue and Athena working, the hard part is getting the results you want, and the CUR isn’t very friendly in that sense. There’s a data field definition available in AWS documentation, though I discovered most of my queries by trying stuff out and trying to match Cost Explorer!!

You can use SQL in Athena - Here’s an example one I like, (taken from the blog

SELECT line_item_product_code, sum(line_item_unblended_cost) AS cost FROM <YOUR TABLE NAME> WHERE year=‘2019’ GROUP BY line_item_product_code HAVING sum(line_item_unblended_cost) > 0 ORDER BY 2 Desc ;

That will give the products you used in 2019, in order of most to least spend.

The same thing is generated in QuickSight (much prettier!!) by creating a new visual, selecting the graph type you want (I like Pie chart for this), then selecting fields “product_product_name” and “line_item_unblended_cost”.

If you make that a stacked bar graph, and add “line_item_usage_start_date” to the X axis, “line_item_unblended_cost” to Y, and “product_product_name” to Color, you get top services per month!

There are many more possibilities, some great graphs are included in the labs above. Perhaps let us know exactly what you want to track and we can give some more info.

Have you talked to your Cloudhealth rep about your reporting issues? I’ve always found them to be very responsive and helpful. You may need to work with your Cloud Ops team for additional tagging to support new perspectives but aside from some very esoteric reporting queries you should be able to get anything you need from Cloudhealth. As other have suggested, getting your Cloud Ops team to configure an Athena table for you to query the CUR files is pretty straight forward. And if you have Enterprise support there is a lot of assistance the billing concierge can provide or even get your account rep to provide the reports you need. Fully utilize the AWS reps at your disposal.

Hey finance guy, I’m DevOps guy been doing work in the area, you can easily setup CUR to export parquet, point Athena table at that, and use that in Quicksight.

We also needed breakdown by Organization OU (for us pretty much “team”) so small lambda export that to parquet too.

I think that’s the best way; accurate to a day, cheap and shareable with QS. The machine learning forecast is cool too.