ripper234
ripper234

Reputation: 230376

How to detach an instance from a Elastic Load Balancer?

I would like to delete/detach an instance from an ELB (but not delete the instance itself).

The API seems to require specific port number/s for DeleteLoadBalancerListeners.

How do I just remove it entirely from the LB (all ports)? (Just like the GUI action "Remove from Load Balancer" in AWS)

I'm using the Java SDK.

Upvotes: 2

Views: 1733

Answers (1)

Mike Hogan
Mike Hogan

Reputation: 10633

To de-register your back-end instance from your load balancer

Call DeregisterInstancesFromLoadBalancer with the following parameters:

Instances = i-4e05f721
LoadBalancerName = MyLoadBalancer

From http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html

Your link to the Java SDK goes to the C# SDK, but in the same API doc you can find

http://docs.aws.amazon.com/sdkfornet/latest/apidocs/html/T_Amazon_ElasticLoadBalancing_Model_DeregisterInstancesFromLoadBalancerRequest.htm

Thats what you're looking for, right?

Upvotes: 2

Related Questions