How to Track Down Amazon Load Balancers with No Target
Discover how to identify and delete unused AWS load balancers to reduce costs and optimize your cloud infrastructure.
Discover how to identify and delete unused AWS load balancers to reduce costs and optimize your cloud infrastructure.
Load balancers help optimize server speed and improve network performance by sending requests to available servers, but when they're not in use, they become an unnecessary expense.
AWS load balancers must be able to connect with healthy, available targets to facilitate a reliable cloud-based network. If you want to save on your cloud platform bill, you should regularly find any load balancers that have no target attached to them and remove them so that you're not paying for more than you need.
In this article, we'll briefly explain the differences between each load balancer type, then show you two ways to find and remove any that are unneeded.
Elastic Load Balancers (ELBs) distribute traffic across multiple targets, sending requests only to servers that are healthy enough to perform the required function. There are three types of ELBs, namely:
Regardless of what type of load balancers you are using, they all need valid targets to function. Here are some of the reasons that a load balancer could end up without a target:
You can remove any type of elastic load balancer using the AWS console. Location, auditing, and deletion can all also be done through the AWS command line interface (CLI), so we'll examine both methods here.
Using the AWS Console:
To identify load balancers with no target through the AWS console, perform the following steps:
Using the AWS CLI:
Alternatively, you may use the AWS CLI for Linux, OSX, or Unix, and perform the following steps:
Here is an example of the command:
Once you run the command, look over the output attributes. If you don’t see an “InstanceID” listed in the “Instances” array, then the load balancer doesn't have a target.
Once you have identified a load balancer without a target, you can now delete it using either of these two methods:
Using the AWS Console:
You can do this through the AWS console by taking the following steps:
Using the AWS CLI:
If using the AWS CLI to delete load balancers, simply use the “delete-load-balancer” command and use the Amazon Resource Name (ARN) to specify which load balancer you want to delete.
If you are using ELBs and want to run this type of check often, there’s a better way than manually running through these steps.
With Blink, you can schedule automated checks like this one to run regularly so you get the benefit without the context-switching.
When this automation runs, it does the following steps:
You can use and customize any of the 5K automations in the Blink library, or build automations from scratch to fit your unique needs.
Get started with Blink today to see how easy automation can be.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.