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.

Container for the parameters to the DeregisterTargets operation. Deregisters the specified targets from the specified target group. After the targets are deregistered, they no longer receive traffic from the load balancer.

The load balancer stops sending requests to targets that are deregistering, but uses connection draining to ensure that in-flight traffic completes on the existing connections. This deregistration delay is configured by default but can be updated for each target group.

For more information, see the following:

Note: If the specified target does not exist, the action returns successfully.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.ElasticLoadBalancingV2.AmazonElasticLoadBalancingV2Request
      Amazon.ElasticLoadBalancingV2.Model.DeregisterTargetsRequest

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

Syntax

C#
public class DeregisterTargetsRequest : AmazonElasticLoadBalancingV2Request
         IAmazonWebServiceRequest

The DeregisterTargetsRequest type exposes the following members

Constructors

NameDescription
Public Method DeregisterTargetsRequest()

Properties

NameTypeDescription
Public Property TargetGroupArn System.String

Gets and sets the property TargetGroupArn.

The Amazon Resource Name (ARN) of the target group.

Public Property Targets System.Collections.Generic.List<Amazon.ElasticLoadBalancingV2.Model.TargetDescription>

Gets and sets the property Targets.

The targets. If you specified a port override when you registered a target, you must specify both the target ID and the port when you deregister it.

Examples

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

To deregister a target from a target group


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


            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

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