# WeightedTargetGroup

A Target Group and weight combination.

Used as argument in: [ListenerAction.weightedForward](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ListenerAction.html#weightedforward)

- Source: [`aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-action.ts#L246)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';

declare const applicationTargetGroup: elbv2.ApplicationTargetGroup;
const weightedTargetGroup: elbv2.WeightedTargetGroup = {
  targetGroup: applicationTargetGroup,

  // the properties below are optional
  weight: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

# application_target_group: elbv2.ApplicationTargetGroup

weighted_target_group = elbv2.WeightedTargetGroup(
    target_group=application_target_group,

    # the properties below are optional
    weight=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.*;

ApplicationTargetGroup applicationTargetGroup;

WeightedTargetGroup weightedTargetGroup = WeightedTargetGroup.builder()
        .targetGroup(applicationTargetGroup)

        // the properties below are optional
        .weight(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;

ApplicationTargetGroup applicationTargetGroup;

var weightedTargetGroup = new WeightedTargetGroup {
    TargetGroup = applicationTargetGroup,

    // the properties below are optional
    Weight = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var applicationTargetGroup ApplicationTargetGroup

weightedTargetGroup := &WeightedTargetGroup{
	TargetGroup: applicationTargetGroup,

	// the properties below are optional
	Weight: jsii.Number(123),
}
```

## Properties

- `targetGroup`: [IApplicationTargetGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationTargetGroup.html) (required) — The target group.

- `weight`: number = 1 — The target group's weight.

  Range is [0..1000).
