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.
Version information
released Jun 15th 2021
Start using this module
Add this module to your Puppetfile:
mod 'binford2k-azure_delete_empty_loadbalancers', '0.0.6'
Learn more about managing modules with a PuppetfileDocumentation
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
Follow these steps to run the workflow:
-
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
- KEY:
- Click Save
-
Click Run workflow and wait for the workflow run page to appear.
-
Supply following parameters to the modal:
- KEY:
dryRun
- VALUE: True if you don't want to perform actual WRITE operations
- KEY:
-
Warning: If you run the workflow with the
dryRun
parameter set tofalse
, 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) orCtrl + /
(Windows) to uncomment.
# triggers:
# - name: schedule
# source:
# type: schedule
# schedule: '0 * * * *'
# binding:
# parameters:
# dryRun: true
- Configure the
schedule
trigger:- Supply the run interval in cron format.
- Configure the following parameter bindings:
- Specify whether
dryRun
should be set totrue
orfalse
.
- Specify whether
- Click Save changes