Skip to content

Commit

Permalink
[COST-5148] filter out empty resource ids and SavingsPlanCoveredUsage…
Browse files Browse the repository at this point in the history
… entries (#5206)

* [COST-5148] update insert sql
filter out empty resource ids
offset savings from SavingsPlanCoveredUsage

* closing CASE statement

* clean up comment

* remove case stmts in favor of filtering out SavingsPlanCoveredUsage

* clean up
  • Loading branch information
djnakabaale authored Jul 9, 2024
1 parent 12d5853 commit fcdf02d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ FROM (
AND year = '{{year | sqlsafe}}'
AND month = '{{month | sqlsafe}}'
AND lineitem_productcode = 'AmazonEC2'
AND product_productfamily LIKE '%Compute%'
AND product_productfamily LIKE '%Compute Instance%'
AND lineitem_resourceid != ''
/* SavingsPlanCoveredUsage entries have corresponding SavingsPlanNegation line items
that offset that cost and usage.
https://docs.aws.amazon.com/cur/latest/userguide/cur-sp.html
*/
AND lineitem_lineitemtype != 'SavingsPlanCoveredUsage'
GROUP BY lineitem_resourceid,
lineitem_usageaccountid,
product_instancetype,
Expand Down

0 comments on commit fcdf02d

Please sign in to comment.