Open6

CURをAthenaで見てみる

not75743not75743

全データを出す

SELECT * FROM "athenacurcfn_general_cost"."general_cost"
not75743not75743

特定の期間のunblended_costを出す

SELECT SUM(line_item_unblended_cost) 
FROM "athenacurcfn_general_cost"."general_cost"
WHERE DATE(line_item_usage_start_date) >= DATE('2023-05-01') AND DATE(line_item_usage_end_date) <= DATE('2023-05-18')
not75743not75743

AWSサービス別の利用料金

SELECT line_item_product_code,SUM(line_item_unblended_cost) AS cost
FROM "athenacurcfn_general_cost"."general_cost"
WHERE year = '2023' AND month = '5' AND line_item_usage_account_id = '<AccountID>'
GROUP BY line_item_product_code
ORDER BY line_item_product_code asc, cost desc;
not75743not75743

税金の除外

SELECT line_item_product_code,SUM(line_item_unblended_cost) AS cost
FROM "athenacurcfn_general_cost"."general_cost"
WHERE year = '2023' AND month = '5' AND line_item_usage_account_id = '<AccountID>'
                    AND line_item_line_item_type NOT IN ('Tax', 'Credit', 'DiscountedUsage', 'Fee', 'Refund', 'RiVolumeDiscount')
                    AND bill_bill_type = 'anniversary'
GROUP BY line_item_product_code
ORDER BY line_item_product_code asc, cost desc;