turbot / steampipe-mod-aws-thrifty

Are you a Thrifty AWS dev? This mod checks your AWS accounts for unused and under-utilized resources using Powerpipe and Steampipe.
https://hub.powerpipe.io/mods/turbot/aws_thrifty
Apache License 2.0
98 stars 19 forks source link

Unexpected AWS Cost Explorer Costs #74

Closed mthbrown closed 2 years ago

mthbrown commented 2 years ago

Describe the bug After starting to use this mod, I noticed that I'm seeing high usage of AWS Cost Explorer. After some digging, it appears that this module makes on average, 71 requests to the Cost Explorer API, which translates to $0.7/day. For production environments, this is a no-brainer but for testing, I thought that there should have been some type of warning as I left Steampipe running for over a month and got about $24 just from running this. I was running it on an AWS Organizations management account

Steampipe version (steampipe -v) v0.13.3

Plugin version (steampipe plugin list) v0.50.1

To reproduce

Expected behavior It would be great if there was some type of warning related to this or some type of way to set this to only run once a day

Additional context

misraved commented 2 years ago

Thanks @mthbrown for using Steampipe 👍 . Great to see that you are using the AWS Thrifty mod.

I see that you are using the 0.50.1 version of the AWS plugin, Could you please update it to the latest? We had made certain updates to our cost tables in this release.

We will definitely pick this up and see if we can bring about more optimisations around the cost tables 👍

cbruno10 commented 2 years ago

Hey @mthbrown , sorry you ran into some unexpected costs!

In order to better understand your environment to help us improve the query and documentation for these checks, can you please provide some more details around the following:

If there are any additional details you feel may be helpful, please include them as well.

Thanks!

cbruno10 commented 2 years ago

@bigdatasourav Can you please have a look at any controls in this mod that query the AWS Cost Explorer API and track how many API requests each control does? This information will be helpful in determining if our controls and queries are optimized.

bigdatasourav commented 2 years ago

@cbruno10 only the full_month_cost_changes control query the AWS Cost Explorer API in this mod. The API request count is dependent on the number of accounts. Per account, the API will hit once for each time the control runs.

cbruno10 commented 2 years ago

Thanks @bigdatasourav for confirming!

@mthbrown Based on our testing, it seems like the control only makes one API call per control run, but if you're still experiencing issues, please let us know and also see the questions in https://github.com/turbot/steampipe-mod-aws-thrifty/issues/74#issuecomment-1117824838, which can help us debug further. Thanks!