How to automate AWS Savings Plan Chargeback/Showback models using AWS Cost & Usage Report,Amazon Athena,AWS Eventbridge, Lambda & Simple Email Service
Automate AWS Savings Plan Chargeback/Showback models using AWS Cost & Usage Report in the most cost effective way!
- Equitable chargeback divides Savings Plan benefits evenly among cost centers, making it simple but inaccurate in reflecting actual usage. it is perceived as fairer but may subsidize high users.
- Non-equitable chargeback allocates benefits based on actual usage, more accurately reflecting true costs though complex to implement.The chargeback aligns costs with consumption but may seem unfair to low users.
Equitable chargeback is simpler while non-equitable is more accurate.
- The best approach depends on needs and priorities between simplicity and accuracy. In summary, the trade-off is between the simplicity of equitable chargeback and the accuracy of non-equitable chargeback.
- You can refer to this [AWS Blog : https://aws.amazon.com/blogs/aws-cloud-financial-management/how-to-build-a-chargeback-showback-model-for-savings-plans-using-the-cur/) for more context.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SELECT
DATE_TRUNC('day', line_item_usage_end_date) AS Date,
bill_payer_account_id AS Payer_ID,
line_item_usage_account_id AS Linked_ID,
SPLIT_PART(savings_plan_savings_plan_a_r_n, '/', 2) AS Savings_Plan_ID,
savings_plan_offering_type AS Savings_Plan_Type,
line_item_product_code AS AWS_Service,
line_item_resource_id AS Resource_ID,
line_item_usage_type AS Usage_Type,
line_item_line_item_Type,
SUM(line_item_usage_amount) as Usage_Amount,
pricing_unit,
line_item_line_item_description,
SUM(line_item_unblended_cost) AS Cost,
pricing_public_on_demand_rate,
SUM(pricing_public_on_demand_cost) as PublicCost,
savings_plan_savings_plan_rate,
SUM(savings_plan_savings_plan_effective_cost) as SavingsPlanCost,
SUM(savings_plan_amortized_upfront_commitment_for_billing_period) AS Savings_Plan_Amortization,
FROM
{}-- insert your cur table name
WHERE
line_item_line_item_Type = 'SavingsPlanCoveredUsage' -- insert criteria if required, this can be customized according to requirement
AND month = '06' --insert month in MM format
AND year = '2023' --insert year in YYYY format
GROUP BY
line_item_usage_end_date, bill_payer_account_id, line_item_usage_account_id, savings_plan_savings_plan_a_r_n, savings_plan_offering_type, line_item_product_code, line_item_resource_id, line_item_usage_type, line_item_line_item_Type, pricing_unit, line_item_unblended_rate, line_item_line_item_description, line_item_unblended_cost, pricing_public_on_demand_rate, savings_plan_savings_plan_rate,





Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.