Skip to content

Commit

Permalink
Update packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
  • Loading branch information
mazyu36 and lpizzinidev authored Jun 14, 2024
1 parent 68ca394 commit 4bcf5b9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/aws-cdk-lib/aws-elasticloadbalancingv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,21 +458,22 @@ const tg = new elbv2.ApplicationTargetGroup(this, 'TG', {
});
```

### Weighted random routing algorithms and automatic target weights for Application Loaf balancer
You can use weighted random routing algorithms by setting `loadBalancingAlgorithmType` to `TargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM`.
When using this algorithm, Automatic Target Weights (ATW) anomaly mitigation can be used by setting `enableAnomalyMitigation` to true.
### Weighted random routing algorithms and automatic target weights for your Application Load Balancer

You can use the `weighted_random` routing algorithms by setting the `loadBalancingAlgorithmType` property.

When using this algorithm, Automatic Target Weights (ATW) anomaly mitigation can be used by setting `enableAnomalyMitigation` to `true`.

For more information, see [Routing algorithms](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#modify-routing-algorithm) and [Automatic Target Weights (ATW)](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#automatic-target-weights).

```ts
declare const vpc: ec2.Vpc;

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

## Using Lambda Targets

Expand Down

0 comments on commit 4bcf5b9

Please sign in to comment.