# NetworkLoadBalancerProps

Properties to define an network load balancer.

- 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#L210)

## 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';
import { aws_route53 as route53 } from 'aws-cdk-lib';

declare const hostedZone: route53.HostedZone;
const networkLoadBalancerProps: ecs_patterns.NetworkLoadBalancerProps = {
  listeners: [{
    name: 'name',

    // the properties below are optional
    port: 123,
  }],
  name: 'name',

  // the properties below are optional
  domainName: 'domainName',
  domainZone: hostedZone,
  publicLoadBalancer: false,
};
```

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
from aws_cdk import aws_route53 as route53

# hosted_zone: route53.HostedZone

network_load_balancer_props = ecs_patterns.NetworkLoadBalancerProps(
    listeners=[ecs_patterns.NetworkListenerProps(
        name="name",

        # the properties below are optional
        port=123
    )],
    name="name",

    # the properties below are optional
    domain_name="domainName",
    domain_zone=hosted_zone,
    public_load_balancer=False
)
```

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.*;
import software.amazon.awscdk.services.route53.*;

HostedZone hostedZone;

NetworkLoadBalancerProps networkLoadBalancerProps = NetworkLoadBalancerProps.builder()
        .listeners(List.of(NetworkListenerProps.builder()
                .name("name")

                // the properties below are optional
                .port(123)
                .build()))
        .name("name")

        // the properties below are optional
        .domainName("domainName")
        .domainZone(hostedZone)
        .publicLoadBalancer(false)
        .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;
using Amazon.CDK.AWS.Route53;

HostedZone hostedZone;

var networkLoadBalancerProps = new NetworkLoadBalancerProps {
    Listeners = new [] { new NetworkListenerProps {
        Name = "name",

        // the properties below are optional
        Port = 123
    } },
    Name = "name",

    // the properties below are optional
    DomainName = "domainName",
    DomainZone = hostedZone,
    PublicLoadBalancer = false
};
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var hostedZone HostedZone

networkLoadBalancerProps := &NetworkLoadBalancerProps{
	Listeners: []NetworkListenerProps{
		&NetworkListenerProps{
			Name: jsii.String("name"),

			// the properties below are optional
			Port: jsii.Number(123),
		},
	},
	Name: jsii.String("name"),

	// the properties below are optional
	DomainName: jsii.String("domainName"),
	DomainZone: hostedZone,
	PublicLoadBalancer: jsii.Boolean(false),
}
```

## Properties

- `domainName`: string — The domain name for the service, e.g. "api.example.com.".

  **Default:** No domain name.

- `domainZone`: [IHostedZone](/cdk/api/v2/docs/aws-cdk-lib.aws_route53.IHostedZone.html) — The Route53 hosted zone for the domain, e.g. "example.com.".

  **Default:** No Route53 hosted domain zone.

- `listeners`: [NetworkListenerProps](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs_patterns.NetworkListenerProps.html)[] (required) = none — Listeners (at least one listener) attached to this load balancer.

- `name`: string (required) — Name of the load balancer.

- `publicLoadBalancer`: boolean = true — Determines whether the Load Balancer will be internet-facing.
