# LoadBalancerTargetProps

Result of attaching a target to load balancer.

Returned by: [IApplicationLoadBalancerTarget.attachToApplicationTargetGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.IApplicationLoadBalancerTarget.html#attachtoapplicationtargetgroup), INetworkLoadBalancerTarget.attachToNetworkTargetGroup, LambdaTarget.attachToNetworkTargetGroup

- Source: [`aws-elasticloadbalancingv2/lib/shared/base-target-group.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts#L612)

## 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 targetJson: any;
const loadBalancerTargetProps: elbv2.LoadBalancerTargetProps = {
  targetType: elbv2.TargetType.INSTANCE,

  // the properties below are optional
  targetJson: targetJson,
};
```

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

# target_json: Any

load_balancer_target_props = elbv2.LoadBalancerTargetProps(
    target_type=elbv2.TargetType.INSTANCE,

    # the properties below are optional
    target_json=target_json
)
```

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.*;

Object targetJson;

LoadBalancerTargetProps loadBalancerTargetProps = LoadBalancerTargetProps.builder()
        .targetType(TargetType.INSTANCE)

        // the properties below are optional
        .targetJson(targetJson)
        .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;

var targetJson;

var loadBalancerTargetProps = new LoadBalancerTargetProps {
    TargetType = TargetType.INSTANCE,

    // the properties below are optional
    TargetJson = targetJson
};
```

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 targetJson interface{}

loadBalancerTargetProps := &LoadBalancerTargetProps{
	TargetType: awscdk.Aws_elasticloadbalancingv2.TargetType_INSTANCE,

	// the properties below are optional
	TargetJson: targetJson,
}
```

## Properties

- `targetJson`: any — JSON representing the target's direct addition to the TargetGroup list.

  May be omitted if the target is going to register itself later.

- `targetType`: [TargetType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.TargetType.html) (required) — What kind of target this is.
