FlexReport for Savings Plan Float
Author: Adam Altschuler
AWS Savings Plans are a powerful way to reduce cloud costs, but understanding how the discounted cost is distributed across accounts can be complicated. This article explains how to use a CloudHealth FlexReport to track Savings Plan benefits from the purchase account to the usage account.

Image 1: The breakdown of Savings Plans floating vs not floating

Image 2: The account that purchased the Savings Plan and the account that used the savings plan in one view
SQL Query
{
"sqlStatement" :
" SELECT
timeInterval_Day AS Day,
COALESCE(
SUM(
CASE
WHEN lineItem_TotalAmortizedCost = 0
OR lineItem_TotalAmortizedCost IS NULL THEN CASE
WHEN lineItem_LineItemType LIKE 'SavingsPlanCoveredUsage' THEN savingsPlan_NetSavingsPlanEffectiveCost
WHEN lineItem_LineItemType NOT IN ('SavingsPlanRecurringFee') THEN lineItem_NetUnblendedCost
WHEN lineItem_LineItemType = 'DiscountedUsage' THEN reservation_NetEffectiveCost
ELSE 0
END
ELSE 0
END
),
0
) ASCloudHealth_Cost,
SUM(lineItem_UsageAmount) AS UsageAmountHours,
savingsPlan_SavingsPlanARN AS SavingsPlan_SavingsPlanARN,
SPLIT_PART (savingsPlan_SavingsPlanARN, ':', 5) AS PurchaseAccountID,
lineItem_UsageAccountId ASUsageAccountID,
\"organization##accountname\" AS UsageAccountName,
savingsPlan_CoverageType AS SavingsPlan_CoverageType,
lineItem_LineItemDescription AS LineItem_LineItemDescription,
product_instanceType AS product_instanceType,
CASE
WHEN SPLIT_PART (savingsPlan_SavingsPlanARN, ':', 5) = lineItem_UsageAccountId THEN 'NO'
ELSE 'YES'
END AS Float,
savingsPlan_PurchaseTerm AS SavingsPlan_PurchaseTerm,
savingsPlan_PurchaseOption AS SavingsPlan_PurchaseOption,
savingsPlan_PaymentOption AS SavingsPlan_PaymentOption,
savingsPlan_OfferingType AS SavingsPlan_OfferingType,
lineItem_ProductCode AS LineItem_ProductCode
FROM
AWS_CUR
WHERE
(savingsPlan_SavingsPlanARN IS NOT NULL)
AND (savingsPlan_CoverageType LIKE '%Plans%')
AND (
lineItem_LineItemDescription NOT LIKE '%Negation%'
)
GROUP BY
timeInterval_Day,
savingsPlan_SavingsPlanARN,
lineItem_UsageAccountId,
\"organization##accountname\",
savingsPlan_CoverageType,
lineItem_LineItemDescription,
savingsPlan_PurchaseTerm,
savingsPlan_PurchaseOption,
savingsPlan_PaymentOption,
savingsPlan_OfferingType,
lineItem_ProductCode,
product_instanceType ",
"needBackLinkingForTags" : true ,
"dataGranularity" : "DAILY" ,
"timeRange" : {
"last": 90
} ,
"limit
What questions does this report answer?
Who is purchasing Savings Plans?
Identify which accounts are responsible for acquiring Savings Plans.
Who is benefiting from Savings Plans?
See which accounts are receiving cost reductions, even if they didn’t purchase the plans themselves.
How much of my EC2, Lambda, and ECS usage is covered by Savings Plans originating from my accounts or floating in from other accounts?
Understand how much of the benefit is coming from Savings Plans I purchased vs. centralized or shared Savings Plans.
How do I forecast and plan for additional purchases when benefits are shared?
Make informed decisions about future Savings Plan investments by analyzing the source of your Savings Plan benefits.
How the Report Works
The Float Report is built using FlexReports, which pulls data directly from the AWS Cost and Usage Report (CUR).
Here’s how it identifies Savings Plan relationships:
Savings Plan ARN:
Every Savings Plan has an Amazon Resource Name (ARN) that includes the account ID of the purchasing account.
NetEffectiveCost:
Effective Cost tells us where the actual usage and associated cost exist. If the resources within an account benefited from the Savings Plan, the effective cost will be in that account.
Combining these two items gives us the ability to display the purchasing account (source) and the usage account (destination) for the cost and usage of each Savings Plan. (please note that usage will be different depending on the service - hours for EC2 or GB for Lambda).
Key Columns:
• PurchaseAccountID: The account that bought the Savings Plan.
• UsageAccountID: The account using the resources.
• UsageAccountName: The name of the account using the resources.
• Float: Will contain “Yes” or “No”.
If “Yes”, the cost/usage floated in from an account other than the usage account.
If “No” the cost/usage did not float (i.e. the Savings Plan was used in the same account that purchased it).
These columns allow you to trace benefits from the purchasing account to the consuming account, helping you understand where the benefit is coming from.
Understanding Cost Allocation
Cost allocation in AWS CUR can be complex, especially when resources are covered by Reserved Instances or Savings Plans. CloudHealth simplifies this by calculating usage-based cost allocation, which many of its reports (like Cost History) rely on.
To replicate this in a FlexReport, use the effectiveCost columns in the CUR. These columns show the cost of RIs/SPs in the account that used them, not the purchasing account.
Here’s the SQL logic used in the FlexReport to calculate this:
COALESCE(
SUM(
CASE
WHEN lineItem_TotalAmortizedCost = 0
OR lineItem_TotalAmortizedCost IS NULL THEN CASE
WHEN lineItem_LineItemType LIKE 'SavingsPlanCoveredUsage' THEN savingsPlan_NetSavingsPlanEffectiveCost
WHEN lineItem_LineItemType NOT IN ('SavingsPlanRecurringFee') THEN lineItem_NetUnblendedCost
WHEN lineItem_LineItemType = 'DiscountedUsage' THEN reservation_NetEffectiveCost
ELSE 0
END
ELSE 0
END
),
0
) AS CloudHealth_Cost
This query ensures that costs are attributed to the account using the resource.