turbot/alicloud_insights

Query: vpc_cidr_blocks

Usage

powerpipe query alicloud_insights.query.vpc_cidr_blocks

Steampipe Tables

SQL

select
cidr_block as "CIDR Block",
power(2, 32 - masklen(cidr_block)) as "Total IPs"
from
alicloud_vpc
where
vpc_id = $1
union all
select
b :: cidr as "CIDR Block",
power(2, 32 - masklen(b :: cidr)) as "Total IPs"
from
alicloud_vpc,
jsonb_array_elements_text(secondary_cidr_blocks) as b
where
vpc_id = $1
union all
select
(b ->> 'Ipv6CidrBlock') :: cidr as "CIDR Block",
power(2, 128 - masklen((b ->> 'Ipv6CidrBlock') :: cidr)) as "Total IPs"
from
alicloud_vpc,
jsonb_array_elements(ipv6_cidr_blocks) as b
where
vpc_id = $1;

Dashboards

The query is used in the dashboards: