detachTrafficSources

Detaches one or more traffic sources from the specified Auto Scaling group.

When you detach a traffic source, it enters the Removing state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the traffic source using the DescribeTrafficSources API call. The instances continue to run.

Samples

import aws.sdk.kotlin.services.autoscaling.model.TrafficSourceIdentifier
fun main() { 
   //sampleStart 
   // This example detaches the specified target group from the specified Auto Scaling group.
val resp = autoScalingClient.detachTrafficSources {
    autoScalingGroupName = "my-auto-scaling-group"
    trafficSources = listOf<TrafficSourceIdentifier>(
        TrafficSourceIdentifier {
            identifier = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
        }            
    )
} 
   //sampleEnd
}