turbot/alicloud_insights

Query: oss_buckets_for_kms_key

Usage

powerpipe query alicloud_insights.query.oss_buckets_for_kms_key

SQL

select
b.arn as bucket_arn
from
alicloud_oss_bucket as b
left join alicloud_kms_key k
on b.server_side_encryption ->> 'KMSMasterKeyID' = k.key_id
where
k.arn = $1
and k.account_id = split_part($1,':',4)
and k.region = split_part($1,':',3)
and b.arn is not null;