:doc:`ElasticLoadBalancing <../../elb>` / Client / detach_load_balancer_from_subnets

*********************************
detach_load_balancer_from_subnets
*********************************



.. py:method:: ElasticLoadBalancing.Client.detach_load_balancer_from_subnets(**kwargs)

  

  Removes the specified subnets from the set of configured subnets for the load balancer.

   

  After a subnet is removed, all EC2 instances registered with the load balancer in the removed subnet go into the ``OutOfService`` state. Then, the load balancer balances the traffic among the remaining routable subnets.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01/DetachLoadBalancerFromSubnets>`_  


  **Request Syntax**
  ::

    response = client.detach_load_balancer_from_subnets(
        LoadBalancerName='string',
        Subnets=[
            'string',
        ]
    )
    
  :type LoadBalancerName: string
  :param LoadBalancerName: **[REQUIRED]** 

    The name of the load balancer.

    

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

    The IDs of the subnets.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'Subnets': [
              'string',
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Contains the output of DetachLoadBalancerFromSubnets.

      
      

      - **Subnets** *(list) --* 

        The IDs of the remaining subnets for the load balancer.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`ElasticLoadBalancing.Client.exceptions.AccessPointNotFoundException`

  
  *   :py:class:`ElasticLoadBalancing.Client.exceptions.InvalidConfigurationRequestException`

  

  **Examples**

  This example detaches the specified load balancer from the specified subnet.
  ::

    response = client.detach_load_balancer_from_subnets(
        LoadBalancerName='my-load-balancer',
        Subnets=[
            'subnet-0ecac448',
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'Subnets': [
            'subnet-15aaab61',
        ],
        'ResponseMetadata': {
            '...': '...',
        },
    }

  