Class NetworkLoadBalancer
Define a new network load balancer.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class NetworkLoadBalancer : BaseLoadBalancer, INetworkLoadBalancer, ILoadBalancerV2, IResource, IVpcEndpointServiceLoadBalancer, IConnectable
Syntax (vb)
Public Class NetworkLoadBalancer
Inherits BaseLoadBalancer
Implements INetworkLoadBalancer, ILoadBalancerV2, IResource, IVpcEndpointServiceLoadBalancer, IConnectable
Remarks
Resource: AWS::ElasticLoadBalancingV2::LoadBalancer
ExampleMetadata: infused
Examples
using Amazon.CDK.HttpNlbIntegration;
var vpc = new Vpc(this, "VPC");
var lb = new NetworkLoadBalancer(this, "lb", new NetworkLoadBalancerProps { Vpc = vpc });
var listener = lb.AddListener("listener", new BaseNetworkListenerProps { Port = 80 });
listener.AddTargets("target", new AddNetworkTargetsProps {
Port = 80
});
var httpEndpoint = new HttpApi(this, "HttpProxyPrivateApi", new HttpApiProps {
DefaultIntegration = new HttpNlbIntegration("DefaultIntegration", listener)
});
Synopsis
Constructors
NetworkLoadBalancer(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
NetworkLoadBalancer(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
NetworkLoadBalancer(Construct, String, INetworkLoadBalancerProps) |
Properties
Connections | The network connections associated with this resource. |
EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic | Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink. |
IpAddressType | The type of IP addresses to use. |
Metrics | All metrics available for this load balancer. |
SecurityGroups | After the implementation of |
Methods
AddListener(String, IBaseNetworkListenerProps) | Add a listener to this load balancer. |
AddSecurityGroup(ISecurityGroup) | Add a security group to this load balancer. |
FromLookup(Construct, String, INetworkLoadBalancerLookupOptions) | Looks up the network load balancer. |
FromNetworkLoadBalancerAttributes(Construct, String, INetworkLoadBalancerAttributes) | |
Metric(String, IMetricOptions) | (deprecated) Return the given named metric for this Network Load Balancer. |
MetricActiveFlowCount(IMetricOptions) | (deprecated) The total number of concurrent TCP flows (or connections) from clients to targets. |
MetricConsumedLCUs(IMetricOptions) | (deprecated) The number of load balancer capacity units (LCU) used by your load balancer. |
MetricNewFlowCount(IMetricOptions) | (deprecated) The total number of new TCP flows (or connections) established from clients to targets in the time period. |
MetricProcessedBytes(IMetricOptions) | (deprecated) The total number of bytes processed by the load balancer, including TCP/IP headers. |
MetricTcpClientResetCount(IMetricOptions) | (deprecated) The total number of reset (RST) packets sent from a client to a target. |
MetricTcpElbResetCount(IMetricOptions) | (deprecated) The total number of reset (RST) packets generated by the load balancer. |
MetricTcpTargetResetCount(IMetricOptions) | (deprecated) The total number of reset (RST) packets sent from a target to a client. |
Constructors
NetworkLoadBalancer(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected NetworkLoadBalancer(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
NetworkLoadBalancer(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected NetworkLoadBalancer(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
NetworkLoadBalancer(Construct, String, INetworkLoadBalancerProps)
public NetworkLoadBalancer(Construct scope, string id, INetworkLoadBalancerProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props INetworkLoadBalancerProps
Properties
Connections
The network connections associated with this resource.
public virtual Connections_ Connections { get; }
Property Value
EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic
Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.
public virtual string EnforceSecurityGroupInboundRulesOnPrivateLinkTraffic { get; }
Property Value
System.String
IpAddressType
The type of IP addresses to use.
public virtual Nullable<IpAddressType> IpAddressType { get; }
Property Value
System.Nullable<IpAddressType>
Metrics
All metrics available for this load balancer.
public virtual INetworkLoadBalancerMetrics Metrics { get; }
Property Value
SecurityGroups
After the implementation of IConnectable
(see https://github.com/aws/aws-cdk/pull/28494), the default value for securityGroups
is set by the ec2.Connections
constructor to an empty array. To keep backward compatibility (securityGroups
is undefined
if the related property is not specified) a getter has been added.
public virtual string[] SecurityGroups { get; }
Property Value
System.String[]
Methods
AddListener(String, IBaseNetworkListenerProps)
Add a listener to this load balancer.
public virtual NetworkListener AddListener(string id, IBaseNetworkListenerProps props)
Parameters
- id System.String
- props IBaseNetworkListenerProps
Returns
The newly created listener
AddSecurityGroup(ISecurityGroup)
Add a security group to this load balancer.
public virtual void AddSecurityGroup(ISecurityGroup securityGroup)
Parameters
- securityGroup ISecurityGroup
FromLookup(Construct, String, INetworkLoadBalancerLookupOptions)
Looks up the network load balancer.
public static INetworkLoadBalancer FromLookup(Construct scope, string id, INetworkLoadBalancerLookupOptions options)
Parameters
- scope Constructs.Construct
- id System.String
- options INetworkLoadBalancerLookupOptions
Returns
FromNetworkLoadBalancerAttributes(Construct, String, INetworkLoadBalancerAttributes)
public static INetworkLoadBalancer FromNetworkLoadBalancerAttributes(Construct scope, string id, INetworkLoadBalancerAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs INetworkLoadBalancerAttributes
Returns
Metric(String, IMetricOptions)
(deprecated) Return the given named metric for this Network Load Balancer.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
Remarks
Default: Average over 5 minutes
Stability: Deprecated
MetricActiveFlowCount(IMetricOptions)
(deprecated) The total number of concurrent TCP flows (or connections) from clients to targets.
public virtual Metric MetricActiveFlowCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
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
Stability: Deprecated
MetricConsumedLCUs(IMetricOptions)
(deprecated) The number of load balancer capacity units (LCU) used by your load balancer.
public virtual Metric MetricConsumedLCUs(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricNewFlowCount(IMetricOptions)
(deprecated) The total number of new TCP flows (or connections) established from clients to targets in the time period.
public virtual Metric MetricNewFlowCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricProcessedBytes(IMetricOptions)
(deprecated) The total number of bytes processed by the load balancer, including TCP/IP headers.
public virtual Metric MetricProcessedBytes(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricTcpClientResetCount(IMetricOptions)
(deprecated) The total number of reset (RST) packets sent from a client to a target.
public virtual Metric MetricTcpClientResetCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
These resets are generated by the client and forwarded by the load balancer.
Default: Sum over 5 minutes
Stability: Deprecated
MetricTcpElbResetCount(IMetricOptions)
(deprecated) The total number of reset (RST) packets generated by the load balancer.
public virtual Metric MetricTcpElbResetCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Default: Sum over 5 minutes
Stability: Deprecated
MetricTcpTargetResetCount(IMetricOptions)
(deprecated) The total number of reset (RST) packets sent from a target to a client.
public virtual Metric MetricTcpTargetResetCount(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
These resets are generated by the target and forwarded by the load balancer.
Default: Sum over 5 minutes
Stability: Deprecated