turbot/oci_insights

Query: compute_instance_public_instance_count

Usage

powerpipe query oci_insights.query.compute_instance_public_instance_count

SQL

with public_ips as (
select
i.title as "title"
from
oci_core_instance as i,
oci_core_vnic_attachment as a
where
i.id = a.instance_id and a.public_ip is not null and i.lifecycle_state <> 'TERMINATED'
)
select
count(*) as value,
'Public Instances' as label,
case count(*) when 0 then 'ok' else 'alert' end as "type"
from
public_ips;

Dashboards

The query is used in the dashboards: