standard
turbot/azure_thrifty

Detect & correct Network Public IPs unattached

Overview

Network Public IP can be quite costly to retain, it is also likely that after a certain point in time they're no longer required and should be cleaned up to prevent further costs.

This query trigger detects unattached public IP 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 configured by setting the below variables

  • network_public_ips_unattached_trigger_enabled should be set to true as the default is false.
  • network_public_ips_unattached_trigger_schedule should be set to your desired running schedule
  • network_public_ips_unattached_default_action should be set to your desired action (i.e. "notify" for notifications or "delete_snapshot" to delete the snapshot).

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(
ip.id,
' [',
ip.resource_group,
'/',
ip.subscription_id,
']'
) as resource,
ip.name,
ip.subscription_id,
ip.resource_group,
ip.sp_connection_name as conn
from
azure_public_ip as ip,
azure_subscription as sub
where
sub.subscription_id = ip.subscription_id
and ip.ip_configuration_id is null;

Schedule

15m

Tags

category = Cost
class = unused
plugin = azure
service = Azure/Network