standard
turbot/azure_thrifty

Detect & correct unused Virtual network gateways

Overview

Virtual Network gateways 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 pipeline detects virtual network gateways exceeding max age and then either sends a notification or attempts to perform a predefined corrective action.

Getting Started

This control will work out-of-the-box with some sensible defaults (configurable via variables).

You should be able to simply run the following command in your terminal:

flowpipe pipeline run detect_and_correct_network_virtual_network_gateways_if_unused

By default, Flowpipe runs in wizard mode and prompts directly in the terminal for a decision on the action(s) to take for each detected resource.

However, you can run Flowpipe in server mode with external integrations, allowing it to prompt for input via http, slack, teams, etc.

Alternatively, you can choose to configure and run in other modes:

  • Notify: Provides detections without taking any corrective action.
  • Automatic: Performs corrective actions automatically without user intervention.

Query

select
concat(g.id, ' [', g.resource_group, '/', g.subscription_id) as title,
g.id,
g.name,
g.resource_group,
g.subscription_id,
g.sp_connection_name as conn
from
azure_virtual_network_gateway as g,
azure_subscription as sub
where
g.gateway_connections is null
and sub.subscription_id = g.subscription_id;

Schedule

15m

Tags

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