deregisterInstancesFromLoadBalancer
abstract suspend fun deregisterInstancesFromLoadBalancer(input: DeregisterInstancesFromLoadBalancerRequest): DeregisterInstancesFromLoadBalancerResponse
Deregisters the specified instances from the specified load balancer. After the instance is deregistered, it no longer receives traffic from the load balancer.
You can use DescribeLoadBalancers to verify that the instance is deregistered from the load balancer.
For more information, see Register or De-Register EC2 Instances in the Classic Load Balancers Guide.
Samples
import aws.sdk.kotlin.services.elasticloadbalancing.model.Instance
fun main() {
//sampleStart
// This example deregisters the specified instance from the specified load balancer.
val resp = elasticLoadBalancingClient.deregisterInstancesFromLoadBalancer {
loadBalancerName = "my-load-balancer"
instances = listOf<Instance>(
Instance {
instanceId = "i-d6f6fae3"
}
)
}
//sampleEnd
}