| Did this page help you? Yes No Tell us about it... |
This example walks you through the process of detaching a subnet from your load balancer using either the AWS Management Console, the Query API, or the command line interfaces.
To detach your load balancer from subnet
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
Click Load Balancers in the Navigation pane.
On the Load Balancers page, select the load balancer that you created for your VPC.
The bottom pane displays the details of your load balancer.
Click the Instances tab.
In the Availability Zones table, click the red minus sign at the right to detach a subnet.
The Add and Remove Subnets page is displayed.

In the Selected Subnets table, click the red circle x to the left of the subnet you want to detach.
The detached subnet becomes available and is displayed in the Available Subnets table.
Click Save to detach the subnet from your load balancer.
To detach your load balancer from subnet
Call DetachLoadBalancerFromSubnets with the
following parameters:
Subnets =
subnet-450f512c
LoadBalancerName = MyVPCLoadBalancer
The operation returns the subnet ID of the detached subnet.
For detailed descriptions of the Elastic Load Balancing API actions, see the Elastic Load Balancing API Reference.
To detach your load balancer from subnet
Enter the command elb-detach-lb-from-subnets as in the following example.
PROMPT> elb-detach-lb-from-subnets MyVPCLoadBalancer --subnets subnet-450f5127
The operation returns the subnet ID of the detached subnet.
For detailed descriptions of the Elastic Load Balancing commands, see the Elastic Load Balancing Quick Reference Card.