turbot/oci_insights

Query: compute_instance_by_public_ip

Usage

powerpipe query oci_insights.query.compute_instance_by_public_ip

SQL

with instances as (
select
case
when a.public_ip is null then 'private'
else 'public'
end as visibility
from
oci_core_instance as i,
oci_core_vnic_attachment as a
where
i.id = a.instance_id and i.lifecycle_state <> 'TERMINATED'
)
select
visibility,
count(*)
from
instances
group by
visibility;

Dashboards

The query is used in the dashboards: