turbot/gcp_insights

Query: compute_disk_attached_instances

Usage

powerpipe query gcp_insights.query.compute_disk_attached_instances

SQL

with disks as (
select
instance_selflink
from
gcp_compute_disk, jsonb_array_elements_text(users) as instance_selflink
where
id = (split_part($1, '/', 1))::bigint
and project = split_part($1, '/', 2)
)
select
i.name as "Name",
i.id::text as "Instance ID",
i.status as "Instance State"
from
disks as d
left join gcp_compute_instance as i on i.self_link = d.instance_selflink;

Dashboards

The query is used in the dashboards: