turbot/aws_insights

Query: vpc_cidr_blocks

Usage

powerpipe query aws_insights.query.vpc_cidr_blocks

Steampipe Tables

SQL

select
b ->> 'CidrBlock' as "CIDR Block",
power(2, 32 - masklen( (b ->> 'CidrBlock'):: cidr)) as "Total IPs"
from
aws_vpc,
jsonb_array_elements(cidr_block_association_set) as b
where
vpc_id = $1
union all
select
b ->> 'Ipv6CidrBlock' as cidr_block,
power(2, 128 - masklen( (b ->> 'Ipv6CidrBlock'):: cidr)) as num_ips
from
aws_vpc,
jsonb_array_elements(ipv6_cidr_block_association_set) as b
where
vpc_id = $1;

Dashboards

The query is used in the dashboards: