turbot/oci_thrifty
Loading controls...

Control: NoSQL tables with stale data should be reviewed

Description

If the data has not changed recently and has become stale, the table should be reviewed.

Usage

Run the control in your terminal:

powerpipe control run oci_thrifty.control.nosql_table_stale_data

Snapshot and share results via Turbot Pipes:

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

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1nosql_table_stale_data_max_days
90
The maximum number of days table data can be unchanged before it is considered stale.

SQL

select
a.id as resource,
case
when date_part('day', now() - (time_updated :: timestamptz)) > $1 then 'alarm'
else 'ok'
end as status,
a.title || ' was changed ' || date_part('day', now() - (time_updated :: timestamptz)) || ' day(s) ago.' as reason,
coalesce(c.name, 'root') as compartment,
a.region
from
oci_nosql_table as a
left join oci_identity_compartment as c on c.id = a.compartment_id;

Tags