detachLoadBalancerTargetGroups method
Detaches one or more target groups from the specified Auto Scaling group.
When you detach a target group, it enters the Removing state
while deregistering the instances in the group. When all instances are
deregistered, then you can no longer describe the target group using the
DescribeLoadBalancerTargetGroups
API call. The instances remain running.
May throw ResourceContentionFault.
Parameter autoScalingGroupName :
The name of the Auto Scaling group.
Parameter targetGroupARNs :
The Amazon Resource Names (ARN) of the target groups. You can specify up
to 10 target groups.
Implementation
Future<void> detachLoadBalancerTargetGroups({
required String autoScalingGroupName,
required List<String> targetGroupARNs,
}) async {
final $request = <String, String>{
'AutoScalingGroupName': autoScalingGroupName,
if (targetGroupARNs.isEmpty)
'TargetGroupARNs': ''
else
for (var i1 = 0; i1 < targetGroupARNs.length; i1++)
'TargetGroupARNs.member.${i1 + 1}': targetGroupARNs[i1],
};
await _protocol.send(
$request,
action: 'DetachLoadBalancerTargetGroups',
version: '2011-01-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'DetachLoadBalancerTargetGroupsResult',
);
}