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

quoted param is not used by control #68

Closed judell closed 2 years ago

judell commented 2 years ago

In old_ebs_snapshots.sql the param is quoted:

when start_time > current_timestamp - interval '$1 days' then 'ok'

As such it's just a string, so the query is incorrect.

per @johnsmyth, this variant works:

when start_time > current_timestamp - ($1 || ' days')::interval then 'ok'

We should probably search for this pattern across the corpus, a quick spot-check found this in gcp-thrifty:

current_date - interval '$1' day
misraved commented 2 years ago

Thanks @judell for raising the issue.

Will look to get the fix out as soon as possible 👍

misraved commented 2 years ago

Fixed in https://github.com/turbot/steampipe-mod-aws-thrifty/pull/69