AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

Note:

For PCL this operation is only available in asynchronous form. Please refer to DeregisterTargetsAsync.

Namespace: Amazon.ElasticLoadBalancingV2
Assembly: AWSSDK.ElasticLoadBalancingV2.dll
Version: 3.x.y.z

Syntax

C#
public abstract DeregisterTargetsResponse DeregisterTargets(
         DeregisterTargetsRequest request
)
Parameters
request
Type: Amazon.ElasticLoadBalancingV2.Model.DeregisterTargetsRequest

Container for the necessary parameters to execute the DeregisterTargets service method.

Return Value
The response from the DeregisterTargets service method, as returned by ElasticLoadBalancingV2.

Exceptions

ExceptionCondition
InvalidTargetException The specified target does not exist or is not in the same VPC as the target group.
TargetGroupNotFoundException The specified target group does not exist.

Examples

This example deregisters the specified instance from the specified target group.

To deregister a target from a target group


var response = client.DeregisterTargets(new DeregisterTargetsRequest 
{
    TargetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067",
    Targets = new List {
        new TargetDescription { Id = "i-0f76fade" }
    }
});


            

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

See Also