turbot/terraform_aws_compliance

Query: vpc_igw_attached_to_authorized_vpc

Usage

powerpipe query terraform_aws_compliance.query.vpc_igw_attached_to_authorized_vpc

Steampipe Tables

SQL

select
address as resource,
case
when name in (select split_part((attributes_std ->> 'vpc_id')::text, '.', 2) from terraform_resource where type = 'aws_internet_gateway') then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when name in (select split_part((attributes_std ->> 'vpc_id')::text, '.', 2) from terraform_resource where type = 'aws_internet_gateway') then ' has internet gateway attachment(s)'
else ' has no internet gateway attachment(s)'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_vpc';

Controls

The query is being used by the following controls: