AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

NetworkTargetGroup

Define a Network Target Group.

Import

import { NetworkTargetGroup } from 'aws-cdk-lib/aws-elasticloadbalancingv2';

Or use the module namespace:

import * as elasticloadbalancingv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
// elasticloadbalancingv2.NetworkTargetGroup

Properties

Configuration passed to the constructor as NetworkTargetGroupProps.

portRequired
number

The port on which the target receives traffic.

connectionTerminationOptional
boolean

Indicates whether the load balancer terminates connections at the end of the deregistration timeout.

Default: false

preserveClientIpOptional
boolean

Indicates whether client IP preservation is enabled.

Default: false if the target group type is IP address and the target group protocol is TCP or TLS. Otherwise, true.

protocolOptional
Protocol

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

Default: - TCP

proxyProtocolV2Optional
boolean

Indicates whether Proxy Protocol version 2 is enabled.

Default: false

targetsOptional
INetworkLoadBalancerTarget[]

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.

Default: - No targets.

8 properties inherited from BaseTargetGroupProps
crossZoneEnabledOptionalinherited from BaseTargetGroupProps
boolean

Indicates whether cross zone load balancing is enabled.

Default: - use load balancer configuration

deregistrationDelayOptionalinherited from BaseTargetGroupProps
Duration

The amount of time for Elastic Load Balancing to wait before deregistering a target. The range is 0-3600 seconds.

Default: 300

healthCheckOptionalinherited from BaseTargetGroupProps
HealthCheck

Health check configuration.

Default: - The default value for each property in this configuration varies depending on the target.

ipAddressTypeOptionalinherited from BaseTargetGroupProps
TargetGroupIpAddressType

The type of IP addresses of the targets registered with the target group.

Default: undefined - ELB defaults to IPv4

targetGroupHealthOptionalinherited from BaseTargetGroupProps
TargetGroupHealth

Configuring target group health.

Default: - use default configuration

targetGroupNameOptionalinherited from BaseTargetGroupProps
string

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.

Default: - Automatically generated.

targetTypeOptionalinherited from BaseTargetGroupProps
TargetType

The type of targets registered to this TargetGroup, either IP or Instance. All targets registered into the group must be of this type. If you register targets to the TargetGroup in the CDK app, the TargetType is determined automatically.

Default: - Determined automatically.

vpcOptionalinherited from BaseTargetGroupProps
IVpc

The virtual private cloud (VPC). only if `TargetType` is `Ip` or `InstanceId`

Default: - undefined

Get the Elastic Load Balancing V2 Cheat Sheet

Everything you need to know about Elastic Load Balancing V2 on one page. HD quality, print-friendly.

Download Free Infographic