turbot / steampipe-mod-aws-insights

View dashboards and reports across all of your AWS accounts using Powerpipe and Steampipe.
https://hub.powerpipe.io/mods/turbot/aws_insights
Apache License 2.0
89 stars 22 forks source link

aws_insights.dashboard.aws_rds_db_cluster_snapshot_dashboard uses wrong query #189

Closed vitalyk-multinarity closed 1 year ago

vitalyk-multinarity commented 2 years ago

Describe the bug Dashboard reports wrong cost metric for RDS snapshots

Steampipe version (steampipe -v) 0.16.4

Plugin version (steampipe plugin list) 0.78.0

To reproduce View cost for RDS [cluster] snapshots Expected behavior I'm not sure how to get proper cost metric for RDS snapshots Additional context Current query in aws_insights.dashboard.aws_rds_db_instance_dashboard for cost is wrong because it presents all RDS cost:

select
  'Cost - MTD' as label,
  sum(unblended_cost_amount) :: numeric :: money as value
from
  aws_cost_by_service_usage_type_monthly as c
where
  service = 'Amazon Relational Database Service'
  and period_end > date_trunc('month', CURRENT_DATE :: timestamp);
misraved commented 2 years ago

Thanks @vitalyk-multinarity for catching the bug and welcome to Steampipe 👍 .

The query definitely seems incorrect since it evaluates the cost of RDS resources as a whole instead of just the snapshots. We will evaluate the query (and the table aws_cost_by_service_usage_type_monthly) once again and check if we have anything in specific for RDS snapshots.

github-actions[bot] commented 1 year ago

'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

github-actions[bot] commented 1 year ago

'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.'

github-actions[bot] commented 1 year ago

'This issue was closed because it has been stalled for 90 days with no activity.'

misraved commented 1 year ago

Addressed in https://github.com/turbot/steampipe-mod-aws-insights/pull/308

misraved commented 1 year ago

@vitalyk-multinarity apologies, but we do not have an API to directly evaluate the cost of RDS DB cluster and instance snapshots.

We have removed the incorrect queries/tables and intend to add them back once we have the API support 👍.