turbot/alicloud_thrifty

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

steampipe check alicloud_thrifty.control.rds_db_instance_long_running

Plugins & Tables

Params

ArgsNameDefaultDescription
$1rds_db_instance_age_max_days
90
The maximum number of days DB instances can be running.
$2rds_db_instance_age_warning_days
30
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,
region,
account_id
from
alicloud_rds_instance
where
pay_type = 'Postpaid';

Tags