library
turbot/aws_thrifty

Detect & correct VPC EIPs if unattached

Overview

Elastic IP addresses are a costly resource to maintain, if they are unattached you will be accruing costs without any benefit; therefore unattached Elastic IP addresses should be released if not required.

This query trigger detects unattached Elastic IP addresses and then either sends a notification or attempts to perform a predefined corrective action.

Getting Started

By default, this trigger is disabled, however it can be configred by setting the below variables

  • vpc_eips_if_unattached_trigger_enabled should be set to true as the default is false.
  • vpc_eips_if_unattached_trigger_schedule should be set to your desired running schedule
  • vpc_eips_if_unattached_default_action should be set to your desired action (i.e. "notify" for notifications or "release" to release the Elastic IP address).

Then starting the server:

flowpipe server

or if you've set the variables in a .fpvars file:

flowpipe server --var-file=/path/to/your.fpvars

Query

select
concat(
allocation_id,
' [',
public_ip,
'/',
region,
'/',
account_id,
']'
) as title,
allocation_id,
region,
_ctx ->> 'connection_name' as cred
from
aws_vpc_eip
where
association_id is null;

Schedule

15m