More Info:
Amazon ELBs should not be idle. Idle ELBs should be terminated to help lower the cost of your monthly AWS bill.Risk Level
LowAddress
Cost OptimisationCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
To remediate the “No Idle ELBs Should Be Present” misconfiguration in AWS using the AWS console, please follow the below steps:
- Login to your AWS console and navigate to the EC2 dashboard.
- Click on the “Load Balancers” link under the “Network & Security” section.
- Identify the idle ELBs by checking the “Status” column. If an ELB is idle, it will have a status of “Active (Idle)”.
- Click on the idle ELB that you want to remediate.
- Click on the “Instances” tab and check if there are any instances attached to the ELB.
- If there are no instances attached, then click on the “Delete” button to delete the idle ELB.
- If there are instances attached, then click on the “Deregister” button to remove the instances from the ELB.
- Once all instances have been removed, click on the “Delete” button to delete the idle ELB.
- Repeat steps 4-8 for all idle ELBs.
Using CLI
Using CLI
To remediate the misconfiguration of having no idle ELBs present in AWS using AWS CLI, follow these steps:Replace Replace
- Identify the idle ELBs present in your AWS account by running the following AWS CLI command:
- Once you have identified the idle ELBs, delete them using the following AWS CLI command:
<load_balancer_name>
with the name of the idle ELB that you want to delete.- Confirm the deletion by running the following AWS CLI command:
<load_balancer_name>
with the name of the idle ELB that you deleted. If the command returns an empty array, it means that the idle ELB has been successfully deleted.- Repeat steps 2 and 3 for all the idle ELBs identified in step 1.
Using Python
Using Python
To remediate the “No Idle ELBs Should Be Present” misconfiguration in AWS using python, follow these steps:Step 1: Import the necessary libraries and configure your AWS credentials.Step 2: Get a list of all the load balancers in your account.Step 3: Loop through the list of load balancers and check if any of them are idle. If an idle load balancer is found, delete it.Step 4: Run the script to remediate the misconfiguration.Note: This script will delete any idle load balancers in your account. Make sure you understand the consequences before running it.That’s it! This script will remediate the “No Idle ELBs Should Be Present” misconfiguration in AWS.