turbot/aws_insights

Query: ec2_instances_for_ebs_volume

Usage

powerpipe query aws_insights.query.ec2_instances_for_ebs_volume

SQL

select
e.arn as instance_arn
from
aws_ebs_volume as v,
jsonb_array_elements(attachments) as a,
aws_ec2_instance as e
where
a ->> 'InstanceId' = e.instance_id
and v.arn = $1
and v.account_id = split_part($1, ':', 5)
and v.region = split_part($1, ':', 4);