turbot/alicloud_insights

Query: kms_key_input

Usage

powerpipe query alicloud_insights.query.kms_key_input

Steampipe Tables

SQL

with key_alias as (
select
p ->> 'AliasName' as title,
p ->> 'KeyId' as key_id
from
alicloud_kms_key,
jsonb_array_elements(key_aliases) as p
)
select
coalesce(a.title, k.title) as label,
arn as value,
json_build_object(
'key_id', a.key_id,
'account_id', account_id,
'region', region
) as tags
from
alicloud_kms_key as k
left join key_alias as a
on a.key_id = k.key_id
order by
a.title;