- 新しい順
- 投票が多い順
- コメントが多い順
Hi Santosh, it seems likely that your Savings Plans utilization for the month of November, 2023 is less than 100%, whereas in previous months the Savings Plans may have been fully utilized. This would indicate less compute usage in November compared to previous months. I recommend running this query from Well-Architected labs site to check your utilization % for both November and a previous month to confirm this. https://wellarchitectedlabs.com/cost-optimization/cur_queries/queries/aws_cost_management/#savings-plans-utilization If you run that, it might be best to change the date filter of WHERE CAST("concat"("year", '-', "month", '-01') AS date) = "date_trunc"('month', current_date) - INTERVAL '1' MONTH which would produce a report for last month from current date to where year = '2023' and month = '11 like you have in your query.
Thanks a lot @rathmyle. I am getting 99.58% Savings Plan utilization for Nov. Hence the $60 diff. How do I drill down to what instance type usage has been reduced for savings plan ?
Santosh - Try this query to identify your EC2 usage by account, resource_id, instance type, pricing term. It should provide enough detail to identify which instances had reduced usage.
-- COMPUTE USAGE PER INSTANCE AND SPLITTING BY PURCHASE OPTION
-- For ${date_filter}, options are listed here: https://wellarchitectedlabs.com/cost/300_labs/300_cur_queries/query_help/#filtering-by-date
-- Example:
-- year = '2022' AND month = '07'
-- -- OR --
-- line_item_usage_start_date >= now() - INTERVAL '3' month
SELECT "line_item_usage_account_id" AS "Account ID",
"line_item_resource_id" AS "Instance ID",
if ("product_instance_type" != '', "product_instance_type", split_part("line_item_line_item_description",' ',1)) AS "Instance Type",
if(split_part("product_instance_type",'.',2) = 'metal', "product_instance_type",if ("product_instance_type_family" != '', "product_instance_type_family", if ("product_instance_type" != '', split_part("product_instance_type",'.',1), split_part("line_item_line_item_description",'.',1)))) AS Family,
sum(if ("pricing_term" = 'Reserved',"line_item_usage_amount",0)) AS Reserved,
sum(if ("pricing_term" = 'OnDemand',"line_item_usage_amount",0)) AS OnDemand,
sum(if ("pricing_term" = '',"line_item_usage_amount",0)) AS Spot
FROM
-- ${table_name} -- Replace ${table_name} with your CUR table name
WHERE "product_product_name" = 'Amazon Elastic Compute Cloud'
AND "line_item_resource_id" LIKE 'i-%'
AND "line_item_operation" LIKE 'RunInstance%'
AND (("line_item_usage_type" LIKE '%BoxUsage%') OR ("line_item_usage_type" LIKE '%SpotUsage%'))
AND
-- ${date_filter} -- Replace ${date_filter} with an option from above.
GROUP BY "line_item_usage_account_id", "line_item_resource_id", "product_instance_type", "line_item_usage_type", "product_instance_type_family", "line_item_line_item_description"```
Thanks a lot @rathmyle. Appreciate your help :)
Here's an additional query you can run to check the $ gap between the Savings Plan commitment and usage:
select line_item_usage_type, product_purchase_option, SUM(savings_plan_total_commitment_to_date) as SP_Total_Commitment, SUM(line_item_unblended_cost) as SP_Unblended_Cost, SUM(savings_plan_used_commitment) as SP_Used_Commitment from <cur_table> where line_item_line_item_type = 'SavingsPlanRecurringFee' group by 1,2
関連するコンテンツ
- AWS公式更新しました 2年前
- AWS公式更新しました 2年前
Did you use partial upfront in your Saving Plan?
@AmerO, no this is a no upfront savings plan.
Hi Santosh, it seems likely that your Savings Plans utilization for the month of November, 2023 is less than 100%, whereas in previous months the Savings Plans may have been fully utilized. This would indicate less compute usage in November compared to previous months. I recommend running this query from Well-Architected labs site to check your utilization % for both November and a previous month to confirm this. https://wellarchitectedlabs.com/cost-optimization/cur_queries/queries/aws_cost_management/#savings-plans-utilization If you run that, it might be best to change the date filter of
WHERE CAST("concat"("year", '-', "month", '-01') AS date) = "date_trunc"('month', current_date) - INTERVAL '1' MONTH
which would produce a report for last month from current date towhere year = '2023' and month = '11
like you have in your query.