turbot/terraform_aws_compliance

Query: rds_db_parameter_group_events_subscription

Usage

powerpipe query terraform_aws_compliance.query.rds_db_parameter_group_events_subscription

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std ->> 'source_type') <> 'db-parameter-group' then 'skip'
when (attributes_std ->> 'source_type') = 'db-parameter-group' and (attributes_std -> 'enabled')::bool and (attributes_std -> 'event_categories_list')::jsonb @> '["failure", "maintenance"]'::jsonb and (attributes_std -> 'event_categories_list')::jsonb <@ '["failure", "maintenance"]'::jsonb then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'source_type') <> 'db-parameter-group' then ' event subscription of ' || (attributes_std ->> 'source_type') || ' type'
when (attributes_std ->> 'source_type') = 'db-parameter-group' and (attributes_std -> 'enabled')::bool and (attributes_std -> 'event_categories_list')::jsonb @> '["failure", "maintenance"]'::jsonb and (attributes_std -> 'event_categories_list')::jsonb <@ '["failure", "maintenance"]'::jsonb then ' event subscription enabled for critical database parameter group events'
else ' event subscription missing critical database parameter group events'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_db_event_subscription';

Controls

The query is being used by the following controls: