Class NetworkLoadBalancer
- All Implemented Interfaces:
IResource,IConnectable,IVpcEndpointServiceLoadBalancer,ILoadBalancerV2,INetworkLoadBalancer,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
Example:
Vpc vpc;
NetworkLoadBalancer lb = NetworkLoadBalancer.Builder.create(this, "LB")
.vpc(vpc)
.ipAddressType(IpAddressType.DUAL_STACK)
.enablePrefixForIpv6SourceNat(true)
.build();
NetworkListener listener = lb.addListener("Listener", BaseNetworkListenerProps.builder()
.port(1229)
.protocol(Protocol.UDP)
.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.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.IResource
IResource.Jsii$Default -
Field Summary
Fields -
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.voidaddSecurityGroup(ISecurityGroup securityGroup) Add a security group 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) The network connections associated with this resource.Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.The type of IP addresses to use.All metrics available for this load balancer.After the implementation ofIConnectable(see https://github.com/aws/aws-cdk/pull/28494), the default value forsecurityGroupsis set by theec2.Connectionsconstructor to an empty array.Deprecated.metric(String metricName, MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.custominsteadDeprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinsteadmetricConsumedLCUs(MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.newFlowCountinsteadmetricNewFlowCount(MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.newFlowCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.processedBytesinsteadDeprecated.UseNetworkLoadBalancer.metrics.processedBytesinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpClientResetCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpClientResetCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpElbResetCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpElbResetCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpTargetResetCountinsteadDeprecated.UseNetworkLoadBalancer.metrics.tcpTargetResetCountinsteadMethods inherited from class software.amazon.awscdk.services.elasticloadbalancingv2.BaseLoadBalancer
getLoadBalancerArn, getLoadBalancerCanonicalHostedZoneId, getLoadBalancerDnsName, getLoadBalancerFullName, getLoadBalancerName, getLoadBalancerSecurityGroups, getVpc, logAccessLogs, logAccessLogs, removeAttribute, resourcePolicyPrincipal, setAttribute, setAttribute, validateLoadBalancerMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, 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.constructs.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.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.ec2.IVpcEndpointServiceLoadBalancer
getLoadBalancerArnMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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
-
addSecurityGroup
Add a security group to this load balancer.- Parameters:
securityGroup- This parameter is required.
-
metric
@Stability(Deprecated) @Deprecated @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.custominstead(deprecated) Return the given named metric for this Network Load Balancer.Default: Average over 5 minutes
- Parameters:
metricName- This parameter is required.props-
-
metric
Deprecated.UseNetworkLoadBalancer.metrics.custominstead(deprecated) Return the given named metric for this Network Load Balancer.Default: Average over 5 minutes
- Parameters:
metricName- This parameter is required.
-
metricActiveFlowCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricActiveFlowCount(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinstead(deprecated) 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
Deprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinstead(deprecated) 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(Deprecated) @Deprecated @NotNull public Metric metricConsumedLCUs(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinstead(deprecated) The number of load balancer capacity units (LCU) used by your load balancer.Default: Sum over 5 minutes
- Parameters:
props-
-
metricConsumedLCUs
Deprecated.UseNetworkLoadBalancer.metrics.activeFlowCountinstead(deprecated) The number of load balancer capacity units (LCU) used by your load balancer.Default: Sum over 5 minutes
-
metricNewFlowCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricNewFlowCount(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.newFlowCountinstead(deprecated) 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
Deprecated.UseNetworkLoadBalancer.metrics.newFlowCountinstead(deprecated) 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(Deprecated) @Deprecated @NotNull public Metric metricProcessedBytes(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.processedBytesinstead(deprecated) The total number of bytes processed by the load balancer, including TCP/IP headers.Default: Sum over 5 minutes
- Parameters:
props-
-
metricProcessedBytes
Deprecated.UseNetworkLoadBalancer.metrics.processedBytesinstead(deprecated) The total number of bytes processed by the load balancer, including TCP/IP headers.Default: Sum over 5 minutes
-
metricTcpClientResetCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricTcpClientResetCount(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.tcpClientResetCountinstead(deprecated) 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
Deprecated.UseNetworkLoadBalancer.metrics.tcpClientResetCountinstead(deprecated) 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(Deprecated) @Deprecated @NotNull public Metric metricTcpElbResetCount(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.tcpElbResetCountinstead(deprecated) The total number of reset (RST) packets generated by the load balancer.Default: Sum over 5 minutes
- Parameters:
props-
-
metricTcpElbResetCount
Deprecated.UseNetworkLoadBalancer.metrics.tcpElbResetCountinstead(deprecated) The total number of reset (RST) packets generated by the load balancer.Default: Sum over 5 minutes
-
metricTcpTargetResetCount
@Stability(Deprecated) @Deprecated @NotNull public Metric metricTcpTargetResetCount(@Nullable MetricOptions props) Deprecated.UseNetworkLoadBalancer.metrics.tcpTargetResetCountinstead(deprecated) 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
Deprecated.UseNetworkLoadBalancer.metrics.tcpTargetResetCountinstead(deprecated) 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
-
getConnections
The network connections associated with this resource.- Specified by:
getConnectionsin interfaceIConnectable
-
getMetrics
All metrics available for this load balancer.- Specified by:
getMetricsin interfaceINetworkLoadBalancer
-
getEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic
@Stability(Stable) @Nullable public String getEnforceSecurityGroupInboundRulesOnPrivateLinkTraffic()Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.- Specified by:
getEnforceSecurityGroupInboundRulesOnPrivateLinkTrafficin interfaceINetworkLoadBalancer
-
getIpAddressType
The type of IP addresses to use.- Specified by:
getIpAddressTypein interfaceINetworkLoadBalancer
-
getSecurityGroups
After the implementation ofIConnectable(see https://github.com/aws/aws-cdk/pull/28494), the default value forsecurityGroupsis set by theec2.Connectionsconstructor to an empty array. To keep backward compatibility (securityGroupsisundefinedif the related property is not specified) a getter has been added.- Specified by:
getSecurityGroupsin interfaceINetworkLoadBalancer
-
NetworkLoadBalancer.metrics.custominstead