Class NetworkLoadBalancer

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, IVpcEndpointServiceLoadBalancer, ILoadBalancerV2, INetworkLoadBalancer, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:44.365Z") @Stability(Stable) public class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoadBalancer
Define a new network load balancer.

Example:

 import software.amazon.awscdk.services.apigatewayv2.integrations.HttpNlbIntegration;
 Vpc vpc = new Vpc(this, "VPC");
 NetworkLoadBalancer lb = NetworkLoadBalancer.Builder.create(this, "lb").vpc(vpc).build();
 NetworkListener listener = lb.addListener("listener", BaseNetworkListenerProps.builder().port(80).build());
 listener.addTargets("target", AddNetworkTargetsProps.builder()
         .port(80)
         .build());
 HttpApi httpEndpoint = HttpApi.Builder.create(this, "HttpProxyPrivateApi")
         .defaultIntegration(new HttpNlbIntegration("DefaultIntegration", listener))
         .build();
 
  • Constructor Details

    • NetworkLoadBalancer

      protected NetworkLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef)
    • NetworkLoadBalancer

      protected NetworkLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • NetworkLoadBalancer

      @Stability(Stable) public NetworkLoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkLoadBalancerProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromLookup

      @Stability(Stable) @NotNull public static INetworkLoadBalancer fromLookup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkLoadBalancerLookupOptions options)
      Looks up the network load balancer.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      options - This parameter is required.
    • fromNetworkLoadBalancerAttributes

      @Stability(Stable) @NotNull public static INetworkLoadBalancer fromNetworkLoadBalancerAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull NetworkLoadBalancerAttributes attrs)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • addListener

      @Stability(Stable) @NotNull public NetworkListener addListener(@NotNull String id, @NotNull BaseNetworkListenerProps props)
      Add a listener to this load balancer.

      Specified by:
      addListener in interface INetworkLoadBalancer
      Parameters:
      id - This parameter is required.
      props - This parameter is required.
      Returns:
      The newly created listener
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this Network Load Balancer.

      Default: Average over 5 minutes

      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this Network Load Balancer.

      Default: Average over 5 minutes

      Parameters:
      metricName - This parameter is required.
    • metricActiveFlowCount

      @Stability(Stable) @NotNull public Metric metricActiveFlowCount(@Nullable MetricOptions props)
      The total number of concurrent TCP flows (or connections) from clients to targets.

      This metric includes connections in the SYN_SENT and ESTABLISHED states. TCP connections are not terminated at the load balancer, so a client opening a TCP connection to a target counts as a single flow.

      Default: Average over 5 minutes

      Parameters:
      props -
    • metricActiveFlowCount

      @Stability(Stable) @NotNull public Metric metricActiveFlowCount()
      The total number of concurrent TCP flows (or connections) from clients to targets.

      This metric includes connections in the SYN_SENT and ESTABLISHED states. TCP connections are not terminated at the load balancer, so a client opening a TCP connection to a target counts as a single flow.

      Default: Average over 5 minutes

    • metricConsumedLCUs

      @Stability(Stable) @NotNull public Metric metricConsumedLCUs(@Nullable MetricOptions props)
      The number of load balancer capacity units (LCU) used by your load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricConsumedLCUs

      @Stability(Stable) @NotNull public Metric metricConsumedLCUs()
      The number of load balancer capacity units (LCU) used by your load balancer.

      Default: Sum over 5 minutes

    • metricHealthyHostCount

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricHealthyHostCount(@Nullable MetricOptions props)
      Deprecated.
      use NetworkTargetGroup.metricHealthyHostCount instead
      (deprecated) The number of targets that are considered healthy.

      Default: Average over 5 minutes

      Parameters:
      props -
    • metricHealthyHostCount

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricHealthyHostCount()
      Deprecated.
      use NetworkTargetGroup.metricHealthyHostCount instead
      (deprecated) The number of targets that are considered healthy.

      Default: Average over 5 minutes

    • metricNewFlowCount

      @Stability(Stable) @NotNull public Metric metricNewFlowCount(@Nullable MetricOptions props)
      The total number of new TCP flows (or connections) established from clients to targets in the time period.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricNewFlowCount

      @Stability(Stable) @NotNull public Metric metricNewFlowCount()
      The total number of new TCP flows (or connections) established from clients to targets in the time period.

      Default: Sum over 5 minutes

    • metricProcessedBytes

      @Stability(Stable) @NotNull public Metric metricProcessedBytes(@Nullable MetricOptions props)
      The total number of bytes processed by the load balancer, including TCP/IP headers.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricProcessedBytes

      @Stability(Stable) @NotNull public Metric metricProcessedBytes()
      The total number of bytes processed by the load balancer, including TCP/IP headers.

      Default: Sum over 5 minutes

    • metricTcpClientResetCount

      @Stability(Stable) @NotNull public Metric metricTcpClientResetCount(@Nullable MetricOptions props)
      The total number of reset (RST) packets sent from a client to a target.

      These resets are generated by the client and forwarded by the load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricTcpClientResetCount

      @Stability(Stable) @NotNull public Metric metricTcpClientResetCount()
      The total number of reset (RST) packets sent from a client to a target.

      These resets are generated by the client and forwarded by the load balancer.

      Default: Sum over 5 minutes

    • metricTcpElbResetCount

      @Stability(Stable) @NotNull public Metric metricTcpElbResetCount(@Nullable MetricOptions props)
      The total number of reset (RST) packets generated by the load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricTcpElbResetCount

      @Stability(Stable) @NotNull public Metric metricTcpElbResetCount()
      The total number of reset (RST) packets generated by the load balancer.

      Default: Sum over 5 minutes

    • metricTcpTargetResetCount

      @Stability(Stable) @NotNull public Metric metricTcpTargetResetCount(@Nullable MetricOptions props)
      The total number of reset (RST) packets sent from a target to a client.

      These resets are generated by the target and forwarded by the load balancer.

      Default: Sum over 5 minutes

      Parameters:
      props -
    • metricTcpTargetResetCount

      @Stability(Stable) @NotNull public Metric metricTcpTargetResetCount()
      The total number of reset (RST) packets sent from a target to a client.

      These resets are generated by the target and forwarded by the load balancer.

      Default: Sum over 5 minutes

    • metricUnHealthyHostCount

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricUnHealthyHostCount(@Nullable MetricOptions props)
      Deprecated.
      use NetworkTargetGroup.metricUnHealthyHostCount instead
      (deprecated) The number of targets that are considered unhealthy.

      Default: Average over 5 minutes

      Parameters:
      props -
    • metricUnHealthyHostCount

      @Stability(Deprecated) @Deprecated @NotNull public Metric metricUnHealthyHostCount()
      Deprecated.
      use NetworkTargetGroup.metricUnHealthyHostCount instead
      (deprecated) The number of targets that are considered unhealthy.

      Default: Average over 5 minutes