turbot/steampipe-mod-oci-thrifty

Control: Old MySQL DB systems should be reviewed

Description

Old MySQL DB systems should be reviewed and deleted if not required.

Usage

Run the control in your terminal:

powerpipe control run oci_thrifty.control.mysql_db_system_age

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run oci_thrifty.control.mysql_db_system_age --share

Steampipe Tables

SQL

select
a.id as resource,
case
when date_part('day', now()-a.time_created) > $1 then 'alarm'
when date_part('day', now()-a.time_created) > $2 then 'info'
else 'ok'
end as status,
a.title || ' has been in use for ' || date_part('day', now()-a.time_created) || ' days.' as reason,
coalesce(c.name, 'root') as compartment
, a.region
from
oci_mysql_db_system as a
left join oci_identity_compartment as c on c.id = a.compartment_id
where
a.lifecycle_state <> 'DELETED';

Params

ArgsNameDefaultDescriptionVariable
$1mysql_db_system_age_max_days
90
The maximum number of days DB systems are allowed to run.
$2mysql_db_system_age_warning_days
30
The number of days DB systems can be running before sending a warning.

Tags