Control: 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 aws_thrifty.control.stale_dynamodb_table_data
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_thrifty.control.stale_dynamodb_table_data --share
Steampipe Tables
Params
Args | Name | Default | Description | Variable |
---|---|---|---|---|
$1 | dynamodb_table_stale_data_max_days |
| The maximum number of days table data can be unchanged before it is considered stale. |
SQL
select 'arn:' || partition || ':dynamodb:' || region || ':' || account_id || ':table/' || name as resource, case when latest_stream_label is null then 'info' when date_part('day', now() - (latest_stream_label::timestamptz)) > $1 then 'alarm' else 'ok' end as status, case when latest_stream_label is null then name || ' is not configured for change data capture.' else name || ' was changed ' || date_part('day', now() - (latest_stream_label::timestamptz)) || ' days ago.' end as reason , region, account_idfrom aws_dynamodb_table;