turbot/terraform_aws_compliance

Query: vpc_security_group_associated_to_eni

Usage

powerpipe query terraform_aws_compliance.query.vpc_security_group_associated_to_eni

Steampipe Tables

SQL

select
address as resource,
case
when name in (select split_part((jsonb_array_elements(attributes_std -> 'security_groups')::text), '.', 2) from terraform_resource where type = 'aws_network_interface') then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when name in (select split_part((jsonb_array_elements(attributes_std -> 'security_groups')::text), '.', 2) from terraform_resource where type = 'aws_network_interface') then ' has attached ENI(s)'
else ' has no attached ENI(s)'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_security_group';

Controls

The query is being used by the following controls: