deregisterTargets

Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

The load balancer stops sending requests to targets that are deregistering, but uses connection draining to ensure that in-flight traffic completes on the existing connections. This deregistration delay is configured by default but can be updated for each target group.

For more information, see the following:

Note: If the specified target does not exist, the action returns successfully.

Samples

import aws.sdk.kotlin.services.elasticloadbalancingv2.model.TargetDescription

fun main() { 
   //sampleStart 
   // This example deregisters the specified instance from the specified target group.
elasticLoadBalancingV2Client.deregisterTargets {
    targetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
    targets = listOf<TargetDescription>(
        TargetDescription {
            id = "i-0f76fade"
        }            
    )
} 
   //sampleEnd
}