Control: VPCs should be in use
Description
This control checks whether there are any unused VPCs.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.vpc_not_in_use
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.vpc_not_in_use --share
SQL
This control uses a named query:
with vpc_without_subnet as ( select distinct vpc_id from aws_vpc where vpc_id not in (select vpc_id from aws_vpc_subnet))select arn as resource, case when s.vpc_id is null then 'ok' else 'alarm' end as status, case when s.vpc_id is null then title || ' in use.' else title || ' not in use.' end as reason , region, account_idfrom aws_vpc as v left join vpc_without_subnet as s on s.vpc_id = v.vpc_id;