Class NetworkTargetGroup

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.services.elasticloadbalancingv2.TargetGroupBase
software.amazon.awscdk.services.elasticloadbalancingv2.NetworkTargetGroup
All Implemented Interfaces:
IConstruct, IDependable, INetworkTargetGroup, ITargetGroup, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.385Z") @Stability(Stable) public class NetworkTargetGroup extends TargetGroupBase implements INetworkTargetGroup
Define a Network Target Group.

Example:

 NetworkListener listener;
 AutoScalingGroup asg1;
 AutoScalingGroup asg2;
 NetworkTargetGroup group = listener.addTargets("AppFleet", AddNetworkTargetsProps.builder()
         .port(443)
         .targets(List.of(asg1))
         .build());
 group.addTarget(asg2);
 
  • 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.
    • doImport

      @Stability(Deprecated) @Deprecated @NotNull public static INetworkTargetGroup doImport(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull TargetGroupImportProps props)
      Deprecated.
      Use fromTargetGroupAttributes instead
      (deprecated) Import an existing listener.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
    • addTarget

      @Stability(Stable) public void addTarget(@NotNull @NotNull INetworkLoadBalancerTarget... targets)
      Add a load balancing target to this target group.

      Specified by:
      addTarget in interface INetworkTargetGroup
      Parameters:
      targets - This parameter is required.
    • metricHealthyHostCount

      @Stability(Stable) @NotNull public Metric metricHealthyHostCount(@Nullable MetricOptions props)
      The number of targets that are considered healthy.

      Default: Average over 5 minutes

      Parameters:
      props -
    • metricHealthyHostCount

      @Stability(Stable) @NotNull public Metric metricHealthyHostCount()
      The number of targets that are considered healthy.

      Default: Average over 5 minutes

    • metricUnHealthyHostCount

      @Stability(Stable) @NotNull public Metric metricUnHealthyHostCount(@Nullable MetricOptions props)
      The number of targets that are considered unhealthy.

      Default: Average over 5 minutes

      Parameters:
      props -
    • metricUnHealthyHostCount

      @Stability(Stable) @NotNull public Metric metricUnHealthyHostCount()
      The number of targets that are considered unhealthy.

      Default: Average over 5 minutes

    • registerListener

      @Stability(Stable) public void registerListener(@NotNull INetworkListener listener)
      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 interface INetworkTargetGroup
      Parameters:
      listener - This parameter is required.
    • validate

      @Stability(Stable) @NotNull protected List<String> validate()
      Validate the current construct.

      This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

      Overrides:
      validate in class TargetGroupBase
      Returns:
      An array of validation error messages, or an empty array if the construct is valid.
    • getFirstLoadBalancerFullName

      @Stability(Stable) @NotNull public String getFirstLoadBalancerFullName()
      Full name of first load balancer.
      Specified by:
      getFirstLoadBalancerFullName in class TargetGroupBase