aws-cdk-lib.aws_elasticloadbalancingv2.AddNetworkTargetsProps

interface AddNetworkTargetsProps

LanguageType name
.NETAmazon.CDK.AWS.ElasticLoadBalancingV2.AddNetworkTargetsProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#AddNetworkTargetsProps
Javasoftware.amazon.awscdk.services.elasticloadbalancingv2.AddNetworkTargetsProps
Pythonaws_cdk.aws_elasticloadbalancingv2.AddNetworkTargetsProps
TypeScript (source)aws-cdk-lib » aws_elasticloadbalancingv2 » AddNetworkTargetsProps

Properties for adding new network targets to a listener.

Example

import { HttpNlbIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

const vpc = new ec2.Vpc(this, 'VPC');
const lb = new elbv2.NetworkLoadBalancer(this, 'lb', { vpc });
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
  port: 80,
});

const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
  defaultIntegration: new HttpNlbIntegration('DefaultIntegration', listener),
});

Properties

NameTypeDescription
portnumberThe port on which the listener listens for requests.
deregistrationDelay?DurationThe amount of time for Elastic Load Balancing to wait before deregistering a target.
healthCheck?HealthCheckHealth check configuration.
preserveClientIp?booleanIndicates whether client IP preservation is enabled.
protocol?ProtocolProtocol for target group, expects TCP, TLS, UDP, or TCP_UDP.
proxyProtocolV2?booleanIndicates whether Proxy Protocol version 2 is enabled.
targetGroupName?stringThe name of the target group.
targets?INetworkLoadBalancerTarget[]The targets to add to this target group.

port

Type: number

The port on which the listener listens for requests.


deregistrationDelay?

Type: Duration (optional, default: Duration.minutes(5))

The amount of time for Elastic Load Balancing to wait before deregistering a target.

The range is 0-3600 seconds.


healthCheck?

Type: HealthCheck (optional, default: The default value for each property in this configuration varies depending on the target.)

Health check configuration.

See also: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html#aws-resource-elasticloadbalancingv2-targetgroup-properties


preserveClientIp?

Type: boolean (optional, default: false if the target group type is IP address and the target group protocol is TCP or TLS. Otherwise, true.)

Indicates whether client IP preservation is enabled.


protocol?

Type: Protocol (optional, default: inherits the protocol of the listener)

Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP.


proxyProtocolV2?

Type: boolean (optional, default: false)

Indicates whether Proxy Protocol version 2 is enabled.


targetGroupName?

Type: string (optional, default: Automatically generated)

The name of the target group.

This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.


targets?

Type: INetworkLoadBalancerTarget[] (optional)

The targets to add to this target group.

Can be Instance, IPAddress, or any self-registering load balancing target. If you use either Instance or IPAddress as targets, all target must be of the same type.