detachLoadBalancerFromSubnets

Removes the specified subnets from the set of configured subnets for the load balancer.

After a subnet is removed, all EC2 instances registered with the load balancer in the removed subnet go into the OutOfService state. Then, the load balancer balances the traffic among the remaining routable subnets.

Samples


fun main() { 
   //sampleStart 
   // This example detaches the specified load balancer from the specified subnet.
val resp = elasticLoadBalancingClient.detachLoadBalancerFromSubnets {
    loadBalancerName = "my-load-balancer"
    subnets = listOf<String>(
        "subnet-0ecac448"
    )
} 
   //sampleEnd
}