# Interrogate your cloud cost & usage data with Tailpipe

> Collect and query detailed billing data and visualize usage patterns.

By Turbot Team
Published: 2025-04-16

You might be using Tailpipe to get insights into your cloud access and security posture, but did you know you can also use it to analyze your cloud cost and usage data?

The latest version of the [AWS plugin](https://hub.tailpipe.io/plugins/turbot/aws) for Tailpipe includes tables for cost and usage reporting based on your [CUR 2.0](https://docs.aws.amazon.com/cur/latest/userguide/table-dictionary-cur2.html) and [Legacy CUR](https://docs.aws.amazon.com/cur/latest/userguide/what-is-cur.html) data, as well as [FOCUS 1.0 schema](https://docs.aws.amazon.com/cur/latest/userguide/table-dictionary-focus-1-0-aws.html) data. And with the new [AWS Cost and Usage Insights Mod for Powerpipe](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-aws-cost-usage-report-insights), you can visualize your cost and usage data in [Powerpipe](https://powerpipe.io).

## Configure and collect logs

With the [AWS plugin](https://hub.tailpipe.io/plugins/turbot/aws), configure a [partition](https://tailpipe.io/docs/reference/config-files/partition) for your cost and usage data:

```hcl
connection "aws" "billing_account" {
  profile = "my-billing-account"
}

partition "aws_cost_and_usage_report" "my_cur" {
  source "aws_s3_bucket" {
    connection = connection.aws.billing_account
    bucket     = "aws-cur-billing-bucket"
    prefix     = "my/prefix/"
  }
}
```

With this partition configured, we collect our logs.

```shell
tailpipe collect aws_cost_and_usage_report
```

## Select * from dollars

With the logs collected, we can run some queries to get a sense of our costs. For example, we can see the total cost for each month.

```sql
select
  date_trunc('month', bill_billing_period_start_date) as billing_month,
  round(sum(line_item_unblended_cost), 2) as total_cost
from
  aws_cost_and_usage_report
group by
  billing_month
order by
  billing_month asc;
```

```shell
+---------------------+------------+
| billing_month       | total_cost |
+---------------------+------------+
| 2025-03-01 00:00:00 | 454        |
| 2025-04-01 00:00:00 | 5324.29    |
+---------------------+------------+
```

What about our top 10 services by cost?

```sql
select
  product_service_code,
  round(sum(line_item_unblended_cost), 2) as total_cost
from
  aws_cost_and_usage_report
where
  product_service_code is not null
group by
  product_service_code
order by
  total_cost desc
limit 10;
```

```shell
+----------------------+------------+
| product_service_code | total_cost |
+----------------------+------------+
| AmazonRDS            | 1647.1     |
| AWSLambda            | 846.72     |
| AmazonEC2            | 765.01     |
| AmazonElastiCache    | 430.99     |
| AmazonECR            | 331.86     |
| AmazonCloudWatch     | 245.78     |
| AmazonS3             | 229.73     |
| awskms               | 120.51     |
| AmazonVPC            | 118.18     |
| AWSELB               | 108.09     |
+----------------------+------------+
```

## Visualize in Powerpipe

Running queries in Tailpipe for quick answers to your questions can be helpful, but if you're looking to understanding spending over time, or other dimensions, the [AWS Cost and Usage Insights Mod for Powerpipe](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-aws-cost-usage-report-insights) provides dashboards for just this purpose.

<div style={{width:"100%", textAlign:"center"}}>
  <img alt="Powerpipe main screen" src="/images/blog/2025-04-cost-and-usage/powerpipe-dashboard-list.png" />
</div>

Let's explore a few different dashboards.

### Cost and Usage Report Overview

[This dashboard](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-aws-cost-usage-report-insights/dashboards/dashboard.overview_dashboard) provides a high-level overview of your cost and usage data. It includes a summary of your total costs (with monthly and daily trending) and as well as a breakdown of costs by account and region.

<div style={{width:"100%", textAlign:"center"}}>
  <img alt="Powerpipe main screen" src="/images/blog/2025-04-cost-and-usage/cost-and-usage-report-overview.png" />
</div>

### Cost by Service

If you want to focus on the cost of individual services, [this dashboard](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-aws-cost-usage-report-insights/dashboards/dashboard.cost_by_service_dashboard) provides a breakdown of costs by service. This can help identify which are the most expensive AWS services in an account, as well as the detailed costs per service.

<div style={{width:"100%", textAlign:"center"}}>
  <img alt="Powerpipe main screen" src="/images/blog/2025-04-cost-and-usage/cost-and-usage-report-cost-by-service.png" />
</div>

### Cost by Tag

Tags are a great way to organize and manage your AWS resources. The [Cost and Usage Report: Cost by Tag](https://hub.powerpipe.io/mods/turbot/tailpipe-mod-aws-cost-usage-report-insights/dashboards/dashboard.cost_by_tag_dashboard) gives you a view of the total costs associated with a specific tag key, as well as how costs break down by tag value. You can also see which top 10 tag values contributed the most to your AWS spend.

<div style={{width:"100%", textAlign:"center"}}>
  <img alt="Cost and Usage Report: Cost by Tag dashboard in Powerpipe" src="/images/blog/2025-04-cost-and-usage/cost-and-usage-report-cost-by-tag.png" />
</div>


## See it in action

<div className="flex justify-center">
<iframe 
    class="youtube-video" 
    src="https://www.youtube-nocookie.com/embed/82omksQYsNE"
    frameBorder="0" 
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    allowFullScreen
    title="Interrogate your cloud cost & usage data with Tailpipe"
>
</iframe>
</div>

## Start exploring your AWS cost and usage data

The [Tailpipe AWS Cost and Usage tables](https://hub.tailpipe.io/plugins/turbot/aws/tables/aws_cost_and_usage_report) and the [Powerpipe AWS Cost and Usage Insights Mod](https://hub.tailpipe.io) are available now. [Let us know](https://turbot.com/community/join) what you think!
