turbot/alicloud_insights

Query: ecs_images_for_ecs_snapshot

Usage

powerpipe query alicloud_insights.query.ecs_images_for_ecs_snapshot

SQL

select
images.arn as image_arn
from
alicloud_ecs_image as images,
jsonb_array_elements(images.disk_device_mappings) as ddm,
alicloud_ecs_snapshot as s
where
ddm ->> 'SnapshotId' is not null
and ddm ->> 'SnapshotId' = s.snapshot_id
and s.arn = $1
and s.account_id = split_part($1, ':', 5)
and s.region = split_part($1, ':', 4);