azure_delete_empty_loadbalancers

This workflow finds empty Azure load balancers by locating load balancers that have no backend configurations. It then terminates these load balancers.

Ben Ford

binford2k

553 downloads

274 latest version

3.9 quality score

Version information

  • 0.0.6 (latest)
  • 0.0.5
  • 0.0.4
  • 0.0.3 (deleted)
  • 0.0.2 (deleted)
  • 0.0.1 (deleted)
released Jun 15th 2021

Start using this module

Documentation

binford2k/azure_delete_empty_loadbalancers — version 0.0.6 Jun 15th 2021

This workflow finds empty Azure load balancers by locating load balancers that have no backend configurations. It then terminates these load balancers.

Prerequisites

Before you run this workflow, you will need the following:

  • An Azure Subscription
  • An Azure Service Principal with permissions to manage load balancers.
  • One or more Azure Load Balancers with zero back end configurations.

Run the workflow

Try this workflow

Follow these steps to run the workflow:

  1. Add your Azure credentials as a Connection:

    • Click Setup
    • Find the Connection named my-azure-account and click Edit(✎). Use the following values:
      • KEY: CLIENT ID
      • VALUE: Enter your Azure Client ID associated with the service principal
      • KEY: SECRET
      • VALUE: Enter your Azure Secret associated with the service principal
      • KEY: TENANT ID
      • VALUE: Enter your Azure Tenant ID associated with the service principal
      • KEY: SUBSCRIPTION ID
      • VALUE: Enter your Azure Subscription ID
    • Click Save
  2. Click Run workflow and wait for the workflow run page to appear.

  3. Supply following parameters to the modal:

    • KEY: dryRun
    • VALUE: True if you don't want to perform actual WRITE operations
  4. Warning: If you run the workflow with the dryRun parameter set to false, resources will be immediately terminated.

Run the workflow on a schedule

Follow these steps to run this workflow on a schedule:

  • Un-comment out the Trigger block in the workflow file:

TIP: If you're using the Relay code editor, highlight the triggers section and type ⌘ + / (Mac) or Ctrl + / (Windows) to uncomment.

# triggers:
# - name: schedule
#   source:
#     type: schedule
#     schedule: '0 * * * *'
#   binding:
#     parameters:
#       dryRun: true
  • Configure the schedule trigger:
  • Configure the following parameter bindings:
    • Specify whether dryRun should be set to true or false.
  • Click Save changes