Control: Long running RDS DB instances should have billing type as 'Subscription' instead of 'Pay-as-you-go'.
Description
Subscription billing for long running RDS DB instances is more cost effective and you can receive larger discounts for longer subscription periods.
Usage
Run the control in your terminal:
powerpipe control run alicloud_thrifty.control.rds_db_instance_long_running
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run alicloud_thrifty.control.rds_db_instance_long_running --share
Steampipe Tables
Params
Args | Name | Default | Description | Variable |
---|---|---|---|---|
$1 | rds_db_instance_age_max_days |
| The maximum number of days DB instances can be running. | |
$2 | rds_db_instance_age_warning_days |
| The number of days DB instances can be running before sending a warning. |
SQL
select arn as resource, case when date_part('day', now() - creation_time) > $1 then 'alarm' when date_part('day', now() - creation_time) > $2 then 'info' else 'ok' end as status, title || ' has been in use for ' || date_part('day', now() - creation_time) || ' days.' as reason , account_id, regionfrom alicloud_rds_instancewhere pay_type = 'Postpaid';