turbot/oci_thrifty
Loading controls...

Control: Old Autonomous databases should be reviewed

Description

Old autonomous databases should be deleted if not required.

Usage

Run the control in your terminal:

powerpipe control run oci_thrifty.control.database_autonomous_database_max_age

Snapshot and share results via Turbot Pipes:

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

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1autonomous_database_age_max_days
90
The maximum number of days autonomous databases are allowed to run.
$2autonomous_database_age_warning_days
30
The number of days autonomous databases can be running before sending a warning.

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 || ' of type ' || a.db_workload || ' 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_database_autonomous_database as a
left join oci_identity_compartment as c on c.id = a.compartment_id
where
a.lifecycle_state <> 'DELETED';

Tags