Class NetworkTargetGroup
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.elasticloadbalancingv2.TargetGroupBase
software.amazon.awscdk.services.elasticloadbalancingv2.NetworkTargetGroup
- All Implemented Interfaces:
INetworkTargetGroup
,ITargetGroup
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.106.0 (build e852934)",
date="2025-02-26T00:07:38.144Z")
@Stability(Stable)
public class NetworkTargetGroup
extends TargetGroupBase
implements INetworkTargetGroup
Define a Network Target Group.
Example:
import software.amazon.awscdk.services.elasticloadbalancing.*; import software.amazon.awscdk.services.elasticloadbalancingv2.*; LoadBalancer clb; ApplicationLoadBalancer alb; NetworkLoadBalancer nlb; ApplicationListener albListener = alb.addListener("ALBListener", BaseApplicationListenerProps.builder().port(80).build()); ApplicationTargetGroup albTargetGroup = albListener.addTargets("ALBFleet", AddApplicationTargetsProps.builder().port(80).build()); NetworkListener nlbListener = nlb.addListener("NLBListener", BaseNetworkListenerProps.builder().port(80).build()); NetworkTargetGroup nlbTargetGroup = nlbListener.addTargets("NLBFleet", AddNetworkTargetsProps.builder().port(80).build()); ServerDeploymentGroup deploymentGroup = ServerDeploymentGroup.Builder.create(this, "DeploymentGroup") .loadBalancers(List.of(LoadBalancer.classic(clb), LoadBalancer.application(albTargetGroup), LoadBalancer.network(nlbTargetGroup))) .build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.INetworkTargetGroup
INetworkTargetGroup.Jsii$Default, INetworkTargetGroup.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
ITargetGroup.Jsii$Default
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
NetworkTargetGroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
NetworkTargetGroup
(software.amazon.jsii.JsiiObjectRef objRef) NetworkTargetGroup
(software.constructs.Construct scope, String id, NetworkTargetGroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTarget
(@NotNull INetworkLoadBalancerTarget... targets) Add a load balancing target to this target group.static INetworkTargetGroup
fromTargetGroupAttributes
(software.constructs.Construct scope, String id, TargetGroupAttributes attrs) Import an existing target group.Full name of first load balancer.All metrics available for this target group.Deprecated.Deprecated.UseNetworkTargetGroup.metrics.healthyHostCount
insteadDeprecated.UseNetworkTargetGroup.metrics.healthyHostCount
insteadDeprecated.UseNetworkTargetGroup.metrics.healthyHostCount
insteadvoid
registerListener
(INetworkListener listener) Register a listener that is load balancing to this target group.Methods inherited from class software.amazon.awscdk.services.elasticloadbalancingv2.TargetGroupBase
addLoadBalancerTarget, configureHealthCheck, getDefaultPort, getHealthCheck, getLoadBalancerArns, getLoadBalancerAttached, getLoadBalancerAttachedDependencies, getTargetGroupArn, getTargetGroupFullName, getTargetGroupLoadBalancerArns, getTargetGroupName, getTargetType, setAttribute, setAttribute, setHealthCheck, setTargetType, validateHealthCheck
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ITargetGroup
getLoadBalancerArns, getLoadBalancerAttached, getTargetGroupArn, getTargetGroupName
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
NetworkTargetGroup
protected NetworkTargetGroup(software.amazon.jsii.JsiiObjectRef objRef) -
NetworkTargetGroup
protected NetworkTargetGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
NetworkTargetGroup
@Stability(Stable) public NetworkTargetGroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkTargetGroupProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromTargetGroupAttributes
@Stability(Stable) @NotNull public static INetworkTargetGroup fromTargetGroupAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TargetGroupAttributes attrs) Import an existing target group.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
addTarget
Add a load balancing target to this target group.- Specified by:
addTarget
in interfaceINetworkTargetGroup
- Parameters:
targets
- This parameter is required.
-
metricHealthyHostCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricHealthyHostCount(@Nullable MetricOptions props) Deprecated.UseNetworkTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of targets that are considered healthy.Default: Average over 5 minutes
- Parameters:
props
-
-
metricHealthyHostCount
Deprecated.UseNetworkTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of targets that are considered healthy.Default: Average over 5 minutes
-
metricUnHealthyHostCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricUnHealthyHostCount(@Nullable MetricOptions props) Deprecated.UseNetworkTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of targets that are considered unhealthy.Default: Average over 5 minutes
- Parameters:
props
-
-
metricUnHealthyHostCount
Deprecated.UseNetworkTargetGroup.metrics.healthyHostCount
instead(deprecated) The number of targets that are considered unhealthy.Default: Average over 5 minutes
-
registerListener
Register a listener that is load balancing to this target group.Don't call this directly. It will be called by listeners.
- Specified by:
registerListener
in interfaceINetworkTargetGroup
- Parameters:
listener
- This parameter is required.
-
validateTargetGroup
- Overrides:
validateTargetGroup
in classTargetGroupBase
-
getFirstLoadBalancerFullName
Full name of first load balancer.- Specified by:
getFirstLoadBalancerFullName
in classTargetGroupBase
-
getMetrics
All metrics available for this target group.- Specified by:
getMetrics
in interfaceINetworkTargetGroup
-
NetworkTargetGroup.metrics.healthyHostCount
instead