turbot/alicloud_insights

Query: vpc_ipv4_count

Usage

powerpipe query alicloud_insights.query.vpc_ipv4_count

Steampipe Tables

SQL

with cidrs as (
select
power(2, 32 - masklen(cidr_block)) as num_ips
from
alicloud_vpc
where
vpc_id = $1
union all
select
power(2, 32 - masklen(b:: cidr)) as num_ips
from
alicloud_vpc,
jsonb_array_elements_text(secondary_cidr_blocks) as b
where
vpc_id = $1
)
select
sum(num_ips) as "IPv4 Addresses"
from
cidrs;

Dashboards

The query is used in the dashboards: