Class: AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancer

Inherits:
BaseLoadBalancer
  • Object
show all
Includes:
INetworkLoadBalancer
Defined in:
elastic_load_balancingv2/network_load_balancer.rb

Overview

Define a new network load balancer.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ NetworkLoadBalancer

Returns a new instance of NetworkLoadBalancer.

Parameters:



12
13
14
15
16
17
18
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 12

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancerProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5OZXR3b3JrTG9hZEJhbGFuY2VyUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.from_lookup(scope, id, options) ⇒ AWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancer

Looks up the network load balancer.

Parameters:

Returns:



70
71
72
73
74
75
76
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 70

def self.from_lookup(scope, id, options)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancerLookupOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5OZXR3b3JrTG9hZEJhbGFuY2VyTG9va3VwT3B0aW9ucyJ9")), "options")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_elasticloadbalancingv2.NetworkLoadBalancer", "fromLookup", [scope, id, options])
end

.from_network_load_balancer_attributes(scope, id, attrs) ⇒ AWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancer

Parameters:

Returns:



82
83
84
85
86
87
88
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 82

def self.from_network_load_balancer_attributes(scope, id, attrs)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  attrs = attrs.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::NetworkLoadBalancerAttributes.new(**attrs.transform_keys(&:to_sym)) : attrs
  Jsii::Type.check_type(attrs, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5OZXR3b3JrTG9hZEJhbGFuY2VyQXR0cmlidXRlcyJ9")), "attrs")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_elasticloadbalancingv2.NetworkLoadBalancer", "fromNetworkLoadBalancerAttributes", [scope, id, attrs])
end

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 20

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :load_balancer_arn => { kind: :property, name: "loadBalancerArn", is_optional: false },
    :load_balancer_canonical_hosted_zone_id => { kind: :property, name: "loadBalancerCanonicalHostedZoneId", is_optional: false },
    :load_balancer_dns_name => { kind: :property, name: "loadBalancerDnsName", is_optional: false },
    :load_balancer_full_name => { kind: :property, name: "loadBalancerFullName", is_optional: false },
    :load_balancer_name => { kind: :property, name: "loadBalancerName", is_optional: false },
    :load_balancer_ref => { kind: :property, name: "loadBalancerRef", is_optional: false },
    :load_balancer_security_groups => { kind: :property, name: "loadBalancerSecurityGroups", is_optional: false },
    :vpc => { kind: :property, name: "vpc", is_optional: true },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :metrics => { kind: :property, name: "metrics", is_optional: false },
    :enforce_security_group_inbound_rules_on_private_link_traffic => { kind: :property, name: "enforceSecurityGroupInboundRulesOnPrivateLinkTraffic", is_optional: true },
    :ip_address_type => { kind: :property, name: "ipAddressType", is_optional: true },
    :security_groups => { kind: :property, name: "securityGroups", is_optional: true },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :log_access_logs => { kind: :method, name: "logAccessLogs", is_optional: false },
    :remove_attribute => { kind: :method, name: "removeAttribute", is_optional: false },
    :resource_policy_principal => { kind: :method, name: "resourcePolicyPrincipal", is_optional: false },
    :set_attribute => { kind: :method, name: "setAttribute", is_optional: false },
    :validate_load_balancer => { kind: :method, name: "validateLoadBalancer", is_optional: false },
    :add_listener => { kind: :method, name: "addListener", is_optional: false },
    :add_security_group => { kind: :method, name: "addSecurityGroup", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_active_flow_count => { kind: :method, name: "metricActiveFlowCount", is_optional: false },
    :metric_consumed_lc_us => { kind: :method, name: "metricConsumedLCUs", is_optional: false },
    :metric_new_flow_count => { kind: :method, name: "metricNewFlowCount", is_optional: false },
    :metric_processed_bytes => { kind: :method, name: "metricProcessedBytes", is_optional: false },
    :metric_tcp_client_reset_count => { kind: :method, name: "metricTcpClientResetCount", is_optional: false },
    :metric_tcp_elb_reset_count => { kind: :method, name: "metricTcpElbResetCount", is_optional: false },
    :metric_tcp_target_reset_count => { kind: :method, name: "metricTcpTargetResetCount", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


202
203
204
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 202

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_elasticloadbalancingv2.NetworkLoadBalancer", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_listener(id, props) ⇒ AWSCDK::ElasticLoadBalancingv2::NetworkListener

Add a listener to this load balancer.

Parameters:

Returns:



381
382
383
384
385
386
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 381

def add_listener(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::BaseNetworkListenerProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5CYXNlTmV0d29ya0xpc3RlbmVyUHJvcHMifQ==")), "props")
  jsii_call_method("addListener", [id, props])
end

#add_security_group(security_group) ⇒ void

This method returns an undefined value.

Add a security group to this load balancer.

Parameters:



392
393
394
395
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 392

def add_security_group(security_group)
  Jsii::Type.check_type(security_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "securityGroup")
  jsii_call_method("addSecurityGroup", [security_group])
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



274
275
276
277
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 274

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



291
292
293
294
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 291

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#connectionsAWSCDK::EC2::Connections

The network connections associated with this resource.



209
210
211
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 209

def connections()
  jsii_get_property("connections")
end

Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.

Returns:

  • (String, nil)


223
224
225
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 223

def enforce_security_group_inbound_rules_on_private_link_traffic()
  jsii_get_property("enforceSecurityGroupInboundRulesOnPrivateLinkTraffic")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



108
109
110
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 108

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


297
298
299
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 297

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


311
312
313
314
315
316
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 311

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


326
327
328
329
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 326

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#ip_address_typeAWSCDK::ElasticLoadBalancingv2::IPAddressType?

The type of IP addresses to use.



230
231
232
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 230

def ip_address_type()
  jsii_get_property("ipAddressType")
end

#load_balancer_arnString

The ARN of this load balancer.

Example value: arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-internal-load-balancer/50dc6c495c0c9188

Returns:

  • (String)


138
139
140
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 138

def load_balancer_arn()
  jsii_get_property("loadBalancerArn")
end

#load_balancer_canonical_hosted_zone_idString

The canonical hosted zone ID of this load balancer.

Example value: Z2P70J7EXAMPLE

Returns:

  • (String)


147
148
149
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 147

def load_balancer_canonical_hosted_zone_id()
  jsii_get_property("loadBalancerCanonicalHostedZoneId")
end

#load_balancer_dns_nameString

The DNS name of this load balancer.

Example value: my-load-balancer-424835706.us-west-2.elb.amazonaws.com

Returns:

  • (String)


156
157
158
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 156

def load_balancer_dns_name()
  jsii_get_property("loadBalancerDnsName")
end

#load_balancer_full_nameString

The full name of this load balancer.

Example value: app/my-load-balancer/50dc6c495c0c9188

Returns:

  • (String)


165
166
167
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 165

def load_balancer_full_name()
  jsii_get_property("loadBalancerFullName")
end

#load_balancer_nameString

The name of this load balancer.

Example value: my-load-balancer

Returns:

  • (String)


174
175
176
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 174

def load_balancer_name()
  jsii_get_property("loadBalancerName")
end

#load_balancer_refAWSCDK::Interfaces::AWSElasticloadbalancingv2::LoadBalancerReference

A reference to this load balancer.



181
182
183
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 181

def load_balancer_ref()
  jsii_get_property("loadBalancerRef")
end

#load_balancer_security_groupsArray<String>

Returns:

  • (Array<String>)


186
187
188
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 186

def load_balancer_security_groups()
  jsii_get_property("loadBalancerSecurityGroups")
end

#log_access_logs(bucket, prefix = nil) ⇒ void

This method returns an undefined value.

Enable access logging for this load balancer.

A region must be specified on the stack containing the load balancer; you cannot enable logging on environment-agnostic stacks. See https://docs.aws.amazon.com/cdk/latest/guide/environments.html

Parameters:



339
340
341
342
343
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 339

def log_access_logs(bucket, prefix = nil)
  Jsii::Type.check_type(bucket, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuSUJ1Y2tldCJ9")), "bucket")
  Jsii::Type.check_type(prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "prefix") unless prefix.nil?
  jsii_call_method("logAccessLogs", [bucket, prefix])
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.custom instead

Note:

Default: Average over 5 minutes

Return the given named metric for this Network Load Balancer.

Parameters:

Returns:



404
405
406
407
408
409
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 404

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_active_flow_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.activeFlowCount instead

Note:

Default: Average over 5 minutes

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.

Parameters:

Returns:



421
422
423
424
425
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 421

def metric_active_flow_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricActiveFlowCount", [props])
end

#metric_consumed_lc_us(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.activeFlowCount instead

Note:

Default: Sum over 5 minutes

The number of load balancer capacity units (LCU) used by your load balancer.

Parameters:

Returns:



433
434
435
436
437
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 433

def metric_consumed_lc_us(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricConsumedLCUs", [props])
end

#metric_new_flow_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.newFlowCount instead

Note:

Default: Sum over 5 minutes

The total number of new TCP flows (or connections) established from clients to targets in the time period.

Parameters:

Returns:



445
446
447
448
449
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 445

def metric_new_flow_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNewFlowCount", [props])
end

#metric_processed_bytes(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.processedBytes instead

Note:

Default: Sum over 5 minutes

The total number of bytes processed by the load balancer, including TCP/IP headers.

Parameters:

Returns:



457
458
459
460
461
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 457

def metric_processed_bytes(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricProcessedBytes", [props])
end

#metric_tcp_client_reset_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.tcpClientResetCount instead

Note:

Default: Sum over 5 minutes

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.

Parameters:

Returns:



471
472
473
474
475
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 471

def metric_tcp_client_reset_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricTcpClientResetCount", [props])
end

#metric_tcp_elb_reset_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.tcpElbResetCount instead

Note:

Default: Sum over 5 minutes

The total number of reset (RST) packets generated by the load balancer.

Parameters:

Returns:



483
484
485
486
487
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 483

def metric_tcp_elb_reset_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricTcpElbResetCount", [props])
end

#metric_tcp_target_reset_count(props = nil) ⇒ AWSCDK::CloudWatch::Metric

Deprecated.

Use NetworkLoadBalancer.metrics.tcpTargetResetCount instead

Note:

Default: Sum over 5 minutes

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.

Parameters:

Returns:



497
498
499
500
501
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 497

def metric_tcp_target_reset_count(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricTcpTargetResetCount", [props])
end

#metricsAWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancerMetrics

All metrics available for this load balancer.



216
217
218
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 216

def metrics()
  jsii_get_property("metrics")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


93
94
95
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 93

def node()
  jsii_get_property("node")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


122
123
124
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 122

def physical_name()
  jsii_get_property("physicalName")
end

#remove_attribute(key) ⇒ void

This method returns an undefined value.

Remove an attribute from the load balancer.

Parameters:

  • key (String)


349
350
351
352
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 349

def remove_attribute(key)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  jsii_call_method("removeAttribute", [key])
end

#resource_policy_principalAWSCDK::IAM::IPrincipal



355
356
357
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 355

def resource_policy_principal()
  jsii_call_method("resourcePolicyPrincipal", [])
end

#security_groupsArray<String>?

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.

Returns:

  • (Array<String>, nil)


237
238
239
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 237

def security_groups()
  jsii_get_property("securityGroups")
end

#set_attribute(key, value = nil) ⇒ void

This method returns an undefined value.

Set a non-standard attribute on the load balancer.



365
366
367
368
369
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 365

def set_attribute(key, value = nil)
  Jsii::Type.check_type(key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless value.nil?
  jsii_call_method("setAttribute", [key, value])
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



129
130
131
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 129

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


244
245
246
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 244

def to_string()
  jsii_call_method("toString", [])
end

#validate_load_balancerArray<String>

Returns:

  • (Array<String>)


372
373
374
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 372

def validate_load_balancer()
  jsii_call_method("validateLoadBalancer", [])
end

#vpcAWSCDK::EC2::IVPC?

The VPC this load balancer has been created in.

This property is always defined (not null or undefined) for sub-classes of BaseLoadBalancer.

Returns:



195
196
197
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 195

def vpc()
  jsii_get_property("vpc")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


257
258
259
260
261
262
# File 'elastic_load_balancingv2/network_load_balancer.rb', line 257

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end