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
Request Syntax
response = client.detach_load_balancer_from_subnets(
LoadBalancerName='string',
Subnets=[
'string',
]
)
[REQUIRED]
The name of the load balancer.
[REQUIRED]
The IDs of the subnets.
dict
Response Syntax
{
'Subnets': [
'string',
]
}
Response Structure
(dict) --
Contains the output of DetachLoadBalancerFromSubnets.
Subnets (list) --
The IDs of the remaining subnets for the load balancer.
Exceptions
ElasticLoadBalancing.Client.exceptions.AccessPointNotFoundException
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': {
'...': '...',
},
}