How to Remove an EC2 Instance from an Existing AWS Elastic Load Balancer (ELB)

How to Remove an EC2 Instance from an Existing AWS Elastic Load Balancer (ELB)

Check out the guide on how create an ELB with HTTP support and how to attach additional instances to AWS ELB. This guide shows how to remove an instance from an existing ELB manually.

Using the AWS UI Console

Login to your AWS account console and enter the EC2 section. Click “Load balancers” on the left pane.

1. Select the Load Balancer and click on the tab “Description”. It will list the ELB info such as DNS Name and Status of instances.

2. Click on the tab “Instances”. It will list the current instances as well as the availability zones. Click “Remove from Load Balancer” for any of the instances.

[Newvem analyzes your baseline disaster recovery (DR) status, reflecting how well AWS DR best practices have been implemented, and recommends AWS features and best practices to reach optimal availability, increase outage protection, and quick recovery. Learn more about Newvem's features]

3. That instance will be removed from the ELB immediately, without a warning message.

4. If you want to remove multiple instances from the same ELB, click on the “+/-” button highlighted above. It will list all the instances available in the current region. Unmark the instances you want to remove from the ELB. Click “Save”.

5. On the confirmation page, click “Close”.

6. The ELB has now only one instance available.

Using the AWS CLI tools

7. To execute the same process through a command line interface, run the following commands.

8. Make sure to set the AWS ELB CLI.

Set the region in command prompt:


Check the instance details with the command below:

elb-describe-lbs AWSFirstELB

Check the health of the ELB instances:

elb-describe-instance-health AWSFirstELB

To remove an instance from an existing ELB, first get the instance ID and then run the following command:

elb-deregister-instances-from-lb AWSFirstELB --instances i-81435db2

Wait for some time and then run a command to verify that the instance was removed.

elb-describe-instance-health AWSFirstELB

9. The output of all the above commands is shown below.

[Newvem analytics tracks you AWS cloud utilization:

Create Your Free Account or Learn more about Newvem]

Keywords: Amazon web services, Amazon AWS console, Amazon Cloud Services, AWS Management Console, AWS ELB, Elastic Load Balancer, CLI, Command Line Tools, Cloud Cost, AWS API, AWS UI Console, Load balancer, EC2

You must be to post a comment.

* As a bonus, you'll receive our weekly newsletter!

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations