turbot/aws_insights

Query: vpc_subnet_details_for_vpc

Usage

powerpipe query aws_insights.query.vpc_subnet_details_for_vpc

Steampipe Tables

SQL

with subnets as (
select
subnet_id,
tags,
cidr_block,
availability_zone,
available_ip_address_count,
power(2, 32 - masklen(cidr_block :: cidr)) -1 as raw_size
from
aws_vpc_subnet
where
vpc_id = $1
)
select
subnet_id as "Subnet ID",
tags ->> 'Name' as "Name",
cidr_block as "CIDR Block",
availability_zone as "Availbility Zone",
available_ip_address_count as "Available IPs",
power(2, 32 - masklen(cidr_block :: cidr)) -1 as "Total IPs",
round(100 * (available_ip_address_count / (raw_size))::numeric, 2) as "% Free"
from
subnets
order by
subnet_id;

Dashboards

The query is used in the dashboards: