turbot/oci_insights

Query: compute_instance_input

Usage

powerpipe query oci_insights.query.compute_instance_input

SQL

select
i.display_name as label,
i.id as value,
json_build_object(
'i.id', right(reverse(split_part(reverse(i.id), '.', 1)), 8),
'i.region', region,
'oic.name', coalesce(oic.title, 'root'),
't.name', t.name
) as tags
from
oci_core_instance as i
left join oci_identity_compartment as oic on i.compartment_id = oic.id
left join oci_identity_tenancy as t on i.tenant_id = t.id
where
i.lifecycle_state <> 'TERMINATED'
order by
i.display_name;