turbot/aws_compliance

Query: kms_key_not_pending_deletion

Usage

powerpipe query aws_compliance.query.kms_key_not_pending_deletion

Steampipe Tables

SQL

select
arn as resource,
case
when key_state = 'PendingDeletion' then 'alarm'
else 'ok'
end as status,
case
when key_state = 'PendingDeletion' then title || ' scheduled for deletion and will be deleted in ' || extract(day from deletion_date - current_timestamp) || ' day(s).'
else title || ' not scheduled for deletion.'
end as reason
, region, account_id
from
aws_kms_key
where
key_manager = 'CUSTOMER';

Controls

The query is being used by the following controls: