turbot/ibm_insights

Query: ibm_is_vpc_by_rfc1918_range

Usage

powerpipe query ibm_insights.query.ibm_is_vpc_by_rfc1918_range

Steampipe Tables

SQL

with cidr_buckets as (
select
id,
title,
a ->> 'cidr' as cidr,
case
when (a ->> 'cidr')::cidr <<= '10.0.0.0/8'::cidr then '10.0.0.0/8'
when (a ->> 'cidr')::cidr <<= '172.16.0.0/12'::cidr then '172.16.0.0/12'
when (a ->> 'cidr')::cidr <<= '192.168.0.0/16'::cidr then '192.168.0.0/16'
else 'Public Range'
end as rfc1918_bucket
from
ibm_is_vpc,
jsonb_array_elements(address_prefixes) as a
)
select
rfc1918_bucket,
count(*)
from
cidr_buckets
group by
rfc1918_bucket
order by
rfc1918_bucket;

Dashboards

The query is used in the dashboards: