Skip to content
v2.277.0

TargetGroupLoadBalancingAlgorithmType Enum ​

Load balancing algorithmm type for target groups.

Example ​

ts
declare const vpc: ec2.Vpc;

const tg = new elbv2.ApplicationTargetGroup(this, 'TargetGroup', {
  vpc,
  loadBalancingAlgorithmType: elbv2.TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM,
  enableAnomalyMitigation: true,
});
python
# vpc: ec2.Vpc


tg = elbv2.ApplicationTargetGroup(self, "TargetGroup",
    vpc=vpc,
    load_balancing_algorithm_type=elbv2.TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM,
    enable_anomaly_mitigation=True
)
java
Vpc vpc;


ApplicationTargetGroup tg = ApplicationTargetGroup.Builder.create(this, "TargetGroup")
        .vpc(vpc)
        .loadBalancingAlgorithmType(TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM)
        .enableAnomalyMitigation(true)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;


var tg = new ApplicationTargetGroup(this, "TargetGroup", new ApplicationTargetGroupProps {
    Vpc = vpc,
    LoadBalancingAlgorithmType = TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM,
    EnableAnomalyMitigation = true
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc


tg := elbv2.NewApplicationTargetGroup(this, jsii.String("TargetGroup"), &ApplicationTargetGroupProps{
	Vpc: Vpc,
	LoadBalancingAlgorithmType: elbv2.TargetGroupLoadBalancingAlgorithmType_WEIGHTED_RANDOM,
	EnableAnomalyMitigation: jsii.Boolean(true),
})

Members ​

MemberDescription
ROUND_ROBINround_robin.
LEAST_OUTSTANDING_REQUESTSleast_outstanding_requests.
WEIGHTED_RANDOMweighted_random.

Referenced by ​

  • AddApplicationTargetsProps.loadBalancingAlgorithmTypeload_balancing_algorithm_typeloadBalancingAlgorithmTypeLoadBalancingAlgorithmTypeLoadBalancingAlgorithmType
  • ApplicationTargetGroupProps.loadBalancingAlgorithmTypeload_balancing_algorithm_typeloadBalancingAlgorithmTypeLoadBalancingAlgorithmTypeLoadBalancingAlgorithmType