turbot/aws_insights

Query: vpc_num_ips_for_vpc

Usage

powerpipe query aws_insights.query.vpc_num_ips_for_vpc

Steampipe Tables

SQL

with cidrs as (
select
b ->> 'CidrBlock' as cidr_block,
masklen(( b ->> 'CidrBlock')::cidr) as "Mask Length",
power(2, 32 - masklen( (b ->> 'CidrBlock'):: cidr)) as num_ips
from
aws_vpc,
jsonb_array_elements(cidr_block_association_set) as b
where vpc_id = $1
)
select
sum(num_ips) as "IP Addresses"
from
cidrs

Dashboards

The query is used in the dashboards: