AWS Cost and Usage Report

AWS Cost and Usage Report

Beta
Beta release

This source is currently in beta. It works end to end, but you may still hit rough edges. Let us know if you do.

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Connect AWS Cost and Usage Report to PostHog to sync your data into the PostHog data warehouse for analysis and modeling.

Sync the line items of an AWS Data Exports export (Cost and Usage Report 2.0 or FOCUS) from its S3 bucket into the PostHog Data warehouse.

Create the export in the AWS Billing console under Data Exports, delivered to S3 as Parquet or gzip CSV. Parquet keeps the column types of the export; gzip CSV takes them from the export's manifest. Then create an IAM user or role with s3:ListBucket on the bucket and s3:GetObject on the export's prefix, and paste its access key ID and secret access key.

AWS rewrites a whole billing period on each delivery and restates the previous month for up to two weeks after it ends, so every sync rebuilds the table from the latest delivery of each billing period. Each sync reads every month from the first billing period on, and each read counts as synced rows, so start at the earliest month you need.

Configuration

OptionTypeRequired
AWS access key IDtextYes
AWS secret access keypasswordYes
AWS session token (only for temporary credentials)passwordNo
Bucket regiontextYes
S3 buckettextYes
S3 path prefix (as set on the export, empty when none)textNo
Export nametextYes
First billing period to sync (YYYY-MM)textYes

Linking AWS Cost and Usage Report to PostHog

  1. Go to the Data pipeline page in PostHog
  2. Click New source and select AWS Cost and Usage Report
  3. Fill in the required configuration fields
  4. Click Next, select the tables you want to sync, and then press Import

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
cost_and_usage

Every line item of the export, from the latest delivery of each billing period in range.

Full refresh——