turbot/steampipe-mod-aws-compliance

Control: Ensure unused ENIs are removed

Description

Identify and delete any unused Amazon AWS Elastic Network Interfaces in order to adhere to best practices and to avoid reaching the service limit. An AWS Elastic Network Interface (ENI) is pronounced unused when is not attached anymore to an EC2 instance.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.ec2_network_interface_unused

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.ec2_network_interface_unused --share

SQL

This control uses a named query:

select
network_interface_id as resource,
case
when status = 'available' and attached_instance_id is null then 'alarm'
else 'ok'
end as status,
case
when status = 'available' and attached_instance_id is null then title || ' not in use.'
else title || ' in use.'
end as reason
, region, account_id
from
aws_ec2_network_interface;

Tags