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_ageSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run oci_thrifty.control.database_autonomous_database_max_age --shareSteampipe 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 || ' 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.regionfrom  oci_database_autonomous_database as a  left join oci_identity_compartment as c on c.id = a.compartment_idwhere  a.lifecycle_state <> 'DELETED';
Params
| Args | Name | Default | Description | Variable | 
|---|---|---|---|---|
| $1 | autonomous_database_age_max_days |  | The maximum number of days autonomous databases are allowed to run. | |
| $2 | autonomous_database_age_warning_days |  | The number of days autonomous databases can be running before sending a warning. |