turbot/aws_insights

Query: ec2_amis_for_ebs_snapshot

Usage

powerpipe query aws_insights.query.ec2_amis_for_ebs_snapshot

SQL

select
images.image_id as image_id
from
aws_ec2_ami as images,
jsonb_array_elements(images.block_device_mappings) as bdm,
aws_ebs_snapshot as s
where
bdm -> 'Ebs' is not null
and bdm -> 'Ebs' ->> 'SnapshotId' = s.snapshot_id
and s.snapshot_id = $1;