# NetworkTargetProps

Properties to define a network load balancer target group.

- Source: [`aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/network-multiple-target-groups-service-base.ts#L265)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs_patterns as ecs_patterns } from 'aws-cdk-lib';
const networkTargetProps: ecs_patterns.NetworkTargetProps = {
  containerPort: 123,

  // the properties below are optional
  listener: 'listener',
};
```

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_ecs_patterns as ecs_patterns

network_target_props = ecs_patterns.NetworkTargetProps(
    container_port=123,

    # the properties below are optional
    listener="listener"
)
```

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

NetworkTargetProps networkTargetProps = NetworkTargetProps.builder()
        .containerPort(123)

        // the properties below are optional
        .listener("listener")
        .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.ECS.Patterns;

var networkTargetProps = new NetworkTargetProps {
    ContainerPort = 123,

    // the properties below are optional
    Listener = "listener"
};
```

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"

networkTargetProps := &NetworkTargetProps{
	ContainerPort: jsii.Number(123),

	// the properties below are optional
	Listener: jsii.String("listener"),
}
```

## Properties

- `containerPort`: number (required) — The port number of the container.

  Only applicable when using application/network load balancers.

- `listener`: string — Name of the listener the target group attached to.

  **Default:** default listener (first added listener)
