:doc:`AutoScaling <../../autoscaling>` / Client / detach_load_balancer_target_groups

**********************************
detach_load_balancer_target_groups
**********************************



.. py:method:: AutoScaling.Client.detach_load_balancer_target_groups(**kwargs)

  

  .. note::

    

    This API operation is superseded by `DetachTrafficSources <https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DetachTrafficSources.html>`__, which can detach multiple traffic sources types. We recommend using ``DetachTrafficSources`` to simplify how you manage traffic sources. However, we continue to support ``DetachLoadBalancerTargetGroups``. You can use both the original ``DetachLoadBalancerTargetGroups`` API operation and ``DetachTrafficSources`` on the same Auto Scaling group.

    

   

  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 <https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeLoadBalancerTargetGroups.html>`__ API call. The instances remain running.

   

  .. note::

    

    You can use this operation to detach target groups that were attached by using `AttachLoadBalancerTargetGroups <https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachLoadBalancerTargetGroups.html>`__, but not for target groups that were attached by using `AttachTrafficSources <https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachTrafficSources.html>`__.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DetachLoadBalancerTargetGroups>`_  


  **Request Syntax**
  ::

    response = client.detach_load_balancer_target_groups(
        AutoScalingGroupName='string',
        TargetGroupARNs=[
            'string',
        ]
    )
    
  :type AutoScalingGroupName: string
  :param AutoScalingGroupName: **[REQUIRED]** 

    The name of the Auto Scaling group.

    

  
  :type TargetGroupARNs: list
  :param TargetGroupARNs: **[REQUIRED]** 

    The Amazon Resource Names (ARN) of the target groups. You can specify up to 10 target groups.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`AutoScaling.Client.exceptions.ResourceContentionFault`

  

  **Examples**

  This example detaches the specified target group from the specified Auto Scaling group
  ::

    response = client.detach_load_balancer_target_groups(
        AutoScalingGroupName='my-auto-scaling-group',
        TargetGroupARNs=[
            'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067',
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  