turbot/azure_insights

Query: compute_snapshots_for_compute_disk

Usage

powerpipe query azure_insights.query.compute_snapshots_for_compute_disk

SQL

select
lower(s.id) as compute_snapshot_id
from
azure_compute_disk as d
left join azure_compute_snapshot as s on lower(s.source_resource_id) = lower(d.id)
where
s.id is not null
and lower(d.id) = $1
and d.subscription_id = split_part($1, '/', 3)
union
select
lower(s.id) as compute_snapshot_id
from
azure_compute_disk as d
left join azure_compute_snapshot as s on lower(s.id) = lower(d.creation_data_source_resource_id)
where
s.id is not null
and lower(d.id) = $1;