turbot/oci_insights

Query: kms_key_input

Usage

powerpipe query oci_insights.query.kms_key_input

SQL

select
k.name as label,
k.id as value,
json_build_object(
'kv.id', right(reverse(split_part(reverse(kv.id), '.', 1)), 8),
'kv.region', kv.region,
'oci.name', coalesce(oci.title, 'root'),
't.name', t.name
) as tags
from
oci_kms_key as k
left join oci_identity_compartment as oci on k.compartment_id = oci.id
left join oci_kms_key_version as kv on kv.key_id = k.id
left join oci_identity_tenancy as t on k.tenant_id = t.id
where
k.lifecycle_state <> 'DELETED'
and kv.management_endpoint = k.management_endpoint
and kv.region = k.region
order by
k.title ;