Class NetworkLoadBalancer
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IVpcEndpointServiceLoadBalancer,ILoadBalancerV2,INetworkLoadBalancer,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
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();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.INetworkLoadBalancer
INetworkLoadBalancer.Jsii$Default, INetworkLoadBalancer.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNetworkLoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedNetworkLoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) NetworkLoadBalancer(software.constructs.Construct scope, String id, NetworkLoadBalancerProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddListener(String id, BaseNetworkListenerProps props) Add a listener to this load balancer.static INetworkLoadBalancerfromLookup(software.constructs.Construct scope, String id, NetworkLoadBalancerLookupOptions options) Looks up the network load balancer.static INetworkLoadBalancerfromNetworkLoadBalancerAttributes(software.constructs.Construct scope, String id, NetworkLoadBalancerAttributes attrs) Return the given named metric for this Network Load Balancer.metric(String metricName, MetricOptions props) Return the given named metric for this Network Load Balancer.The total number of concurrent TCP flows (or connections) from clients to targets.The total number of concurrent TCP flows (or connections) from clients to targets.The number of load balancer capacity units (LCU) used by your load balancer.metricConsumedLCUs(MetricOptions props) The number of load balancer capacity units (LCU) used by your load balancer.Deprecated.Deprecated.useNetworkTargetGroup.metricHealthyHostCountinsteadThe total number of new TCP flows (or connections) established from clients to targets in the time period.metricNewFlowCount(MetricOptions props) The total number of new TCP flows (or connections) established from clients to targets in the time period.The total number of bytes processed by the load balancer, including TCP/IP headers.The total number of bytes processed by the load balancer, including TCP/IP headers.The total number of reset (RST) packets sent from a client to a target.The total number of reset (RST) packets sent from a client to a target.The total number of reset (RST) packets generated by the load balancer.The total number of reset (RST) packets generated by the load balancer.The total number of reset (RST) packets sent from a target to a client.The total number of reset (RST) packets sent from a target to a client.Deprecated.useNetworkTargetGroup.metricUnHealthyHostCountinsteadDeprecated.useNetworkTargetGroup.metricUnHealthyHostCountinsteadMethods inherited from class software.amazon.awscdk.services.elasticloadbalancingv2.BaseLoadBalancer
getLoadBalancerArn, getLoadBalancerCanonicalHostedZoneId, getLoadBalancerDnsName, getLoadBalancerFullName, getLoadBalancerName, getLoadBalancerSecurityGroups, getVpc, logAccessLogs, logAccessLogs, removeAttribute, setAttribute, setAttribute, validateMethods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesizeMethods inherited from class software.constructs.Construct
toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.ILoadBalancerV2
getLoadBalancerCanonicalHostedZoneId, getLoadBalancerDnsNameMethods inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.INetworkLoadBalancer
getVpcMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.ec2.IVpcEndpointServiceLoadBalancer
getLoadBalancerArnMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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:
addListenerin interfaceINetworkLoadBalancer- 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
Return the given named metric for this Network Load Balancer.Default: Average over 5 minutes
- Parameters:
metricName- This parameter is required.
-
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
- Parameters:
props-
-
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
The number of load balancer capacity units (LCU) used by your load balancer.Default: Sum over 5 minutes
- Parameters:
props-
-
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.useNetworkTargetGroup.metricHealthyHostCountinstead(deprecated) The number of targets that are considered healthy.Default: Average over 5 minutes
- Parameters:
props-
-
metricHealthyHostCount
Deprecated.useNetworkTargetGroup.metricHealthyHostCountinstead(deprecated) The number of targets that are considered healthy.Default: Average over 5 minutes
-
metricNewFlowCount
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
The total number of new TCP flows (or connections) established from clients to targets in the time period.Default: Sum over 5 minutes
-
metricProcessedBytes
The total number of bytes processed by the load balancer, including TCP/IP headers.Default: Sum over 5 minutes
- Parameters:
props-
-
metricProcessedBytes
The total number of bytes processed by the load balancer, including TCP/IP headers.Default: Sum over 5 minutes
-
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
- Parameters:
props-
-
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
The total number of reset (RST) packets generated by the load balancer.Default: Sum over 5 minutes
- Parameters:
props-
-
metricTcpElbResetCount
The total number of reset (RST) packets generated by the load balancer.Default: Sum over 5 minutes
-
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
- Parameters:
props-
-
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.useNetworkTargetGroup.metricUnHealthyHostCountinstead(deprecated) The number of targets that are considered unhealthy.Default: Average over 5 minutes
- Parameters:
props-
-
metricUnHealthyHostCount
Deprecated.useNetworkTargetGroup.metricUnHealthyHostCountinstead(deprecated) The number of targets that are considered unhealthy.Default: Average over 5 minutes
-
NetworkTargetGroup.metricHealthyHostCountinstead