turbot/aws_insights

Query: rds_db_instance_logging_disabled_count

Usage

powerpipe query aws_insights.query.rds_db_instance_logging_disabled_count

Steampipe Tables

SQL

with logging_stat as (
select
db_instance_identifier
from
aws_rds_db_instance
where
( engine like any (array ['mariadb', '%mysql']) and enabled_cloudwatch_logs_exports ?& array ['audit','error','general','slowquery'] ) or
( engine like any (array['%postgres%']) and enabled_cloudwatch_logs_exports ?& array ['postgresql','upgrade'] ) or
( engine like 'oracle%' and enabled_cloudwatch_logs_exports ?& array ['alert','audit', 'trace','listener'] ) or
( engine = 'sqlserver-ex' and enabled_cloudwatch_logs_exports ?& array ['error'] ) or
( engine like 'sqlserver%' and enabled_cloudwatch_logs_exports ?& array ['error','agent'] )
)
select
count(*) as value,
'Logging Disabled' as label,
case count(*) when 0 then 'ok' else 'alert' end as "type"
from
aws_rds_db_instance
where
db_instance_identifier not in (select db_instance_identifier from logging_stat);

Dashboards

The query is used in the dashboards: