Run SQL against the AWS Cost & Usage Report (CUR) to break down Amazon Redshift costs per customer for accurate SaaS pricing.
SQL lets you join Amazon Redshift usage data from the Cost & Usage Report (CUR) with your application tables, so you can allocate costs to customers, orders, or features without leaving your database workflow.
Load the hourly CUR files into an external schema (Spectrum) or a regular table, then create views that expose columns such as line_item_usage_start_date
, product_product_name
, and usage_cost
.
Focus on product_product_name = 'Amazon Redshift'
, line_item_blended_cost
(or net_amortized_cost
), and any tag columns that identify the customer, workspace, or feature.
Yes. Tag Redshift clusters or queries with customer_id
. After the CUR is ingested, join the tag column to your Customers(id)
primary key and aggregate costs.
Allocate the customer’s monthly Redshift cost across their total orders. Divide cost by COUNT(*)
from the Orders
table for the same period.
1) Enable the hourly CUR. 2) Turn on Redshift usage tags. 3) Schedule a nightly ETL that refreshes the CUR table. 4) Store pricing logic in version-controlled views.
Include Redshift Concurrency Scaling
lines in your query. For RA3, add Spectrum and managed-storage charges to avoid surprises.
Create a materialized view that writes per-customer costs to a table your application can read via an API endpoint or GraphQL resolver.
1) Copy CUR to aws_cur.redshift_usage
. 2) Run the sample query below. 3) Insert results into customer_redshift_costs
. 4) Expose the table in your SaaS billing service.
Tagging works on any node type, but RA3 simplifies separating compute from storage, making per-customer allocation cleaner.
Yes. Load the CUR into an external Spectrum schema or regular table and query it like any other relation.
Use session or query tags that include customer_id
. Redshift adds these tags to the CUR, enabling tenant-level cost breakdowns.